From ce83b90ee3a81015a3c720f9250640c6dadb738c Mon Sep 17 00:00:00 2001 From: Andreas Fink Date: Tue, 15 Sep 2009 16:35:32 +0000 Subject: [PATCH] *fix* stop any pending alarms if timeout is 0 --- src/tooltip/tooltip.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tooltip/tooltip.c b/src/tooltip/tooltip.c index 6826aae..978982f 100644 --- a/src/tooltip/tooltip.c +++ b/src/tooltip/tooltip.c @@ -82,8 +82,10 @@ void tooltip_trigger_show(Task* task, int x_root, int y_root) g_tooltip.current_state = TOOLTIP_ABOUT_TO_SHOW; g_tooltip.task = task; struct timeval t = g_tooltip.show_timeout.it_value; - if (t.tv_sec == 0 && t.tv_usec == 0) + if (t.tv_sec == 0 && t.tv_usec == 0) { + alarm(0); tooltip_show(); + } else setitimer(ITIMER_REAL, &g_tooltip.show_timeout, 0); } @@ -229,8 +231,10 @@ void tooltip_trigger_hide(Tooltip* tooltip) if (g_tooltip.mapped) { g_tooltip.current_state = TOOLTIP_ABOUT_TO_HIDE; struct timeval t = g_tooltip.hide_timeout.it_value; - if (t.tv_sec == 0 && t.tv_usec == 0) + if (t.tv_sec == 0 && t.tv_usec == 0) { tooltip_hide(); + alarm(0); + } else setitimer(ITIMER_REAL, &g_tooltip.hide_timeout, 0); } -- 2.45.2