]> Dogcows Code - chaz/tint2/blobdiff - src/tooltip/tooltip.c
*fix* Check wmhints for NULL
[chaz/tint2] / src / tooltip / tooltip.c
index 29552b0cdaf4bc18b71ce3ee8dc5a6f8bea7800d..17b45580a106e04157381dc766cbdf9b6ef459a3 100644 (file)
@@ -1,3 +1,20 @@
+/**************************************************************************
+*
+* Copyright (C) 2009 Andreas.Fink (Andreas.Fink85@gmail.com)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License version 2
+* as published by the Free Software Foundation.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+**************************************************************************/
+
 #include <stdio.h>
 #include <unistd.h>
 #include <cairo.h>
@@ -65,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);
        }
@@ -212,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);
        }
This page took 0.020207 seconds and 4 git commands to generate.