]> Dogcows Code - chaz/tint2/blobdiff - src/tooltip/tooltip.c
many fixed for SIGUSR1 signal
[chaz/tint2] / src / tooltip / tooltip.c
index 978982f7e6a0bfa80934e22d21b45611e5838c41..ca6a5a29a4cb0ef3f2452ec12394eb386b93b1e7 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
 *
-* Copyright (C) 2009 Andreas.Fink85 ()
+* 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
@@ -59,6 +59,26 @@ void init_tooltip()
 }
 
 
+void cleanup_tooltip()
+{
+       tooltip_hide();
+       g_tooltip.enabled = False;
+       g_tooltip.current_state = TOOLTIP_ABOUT_TO_HIDE;
+       if (g_tooltip.task) {
+               alarm(0);
+               g_tooltip.task = 0;
+       }
+       if (g_tooltip.window) {
+               XDestroyWindow(server.dsp, g_tooltip.window);
+               g_tooltip.window = 0;
+       }
+       if (g_tooltip.font_desc) {
+               pango_font_description_free(g_tooltip.font_desc);
+               g_tooltip.font_desc = 0;
+       }
+}
+
+
 void tooltip_sighandler(int sig)
 {
        if (g_tooltip.current_state == TOOLTIP_ABOUT_TO_SHOW)
@@ -231,6 +251,7 @@ 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;
+               g_tooltip.task = 0;
                if (t.tv_sec == 0 && t.tv_usec == 0) {
                        tooltip_hide();
                        alarm(0);
@@ -251,5 +272,4 @@ void tooltip_hide()
                g_tooltip.mapped = False;
                XUnmapWindow(server.dsp, g_tooltip.window);
        }
-       g_tooltip.task = 0;
 }
This page took 0.0223 seconds and 4 git commands to generate.