diff options
author | Arnavion <arnavion@gmail.com> | 2015-02-27 17:24:57 -0800 |
---|---|---|
committer | Arnavion <arnavion@gmail.com> | 2015-02-27 17:24:57 -0800 |
commit | b6c4cfa2a322de5ab3d1dc5f3ab306c1576c24d4 (patch) | |
tree | 16aeb57e36c03cc230f7f0a2f492475abb17afcc | |
parent | ec12871e60796e5ce63303c5be8c75f146edfef8 (diff) |
Fixed undefined behavior causing hover highlights on the plugin tray menu not working.
Fixes #602
-rw-r--r-- | src/fe-gtk/plugin-tray.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index 1ec8d2a3..447bd0cf 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -487,25 +487,30 @@ tray_menu_destroy (GtkWidget *menu, gpointer userdata) } #ifdef WIN32 -static void +static gboolean tray_menu_enter_cb (GtkWidget *menu) { tray_menu_inactivetime = 0; + return FALSE; } -static void +static gboolean tray_menu_left_cb (GtkWidget *menu) { tray_menu_inactivetime = g_get_real_time (); + return FALSE; } -static void +static gboolean tray_check_hide (GtkWidget *menu) { if (tray_menu_inactivetime && g_get_real_time () - tray_menu_inactivetime >= 2000000) { tray_menu_destroy (menu, NULL); + return G_SOURCE_REMOVE; } + + return G_SOURCE_CONTINUE; } static void @@ -581,7 +586,7 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata) g_signal_connect (G_OBJECT (menu), "enter-notify-event", G_CALLBACK (tray_menu_enter_cb), NULL); - tray_menu_timer = g_timeout_add(500, (GSourceFunc) tray_check_hide, menu); + tray_menu_timer = g_timeout_add (500, tray_check_hide, menu); #endif gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, |