From 031e3c13b4333ae8def24f4ccb2f777779d4a3a5 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Mon, 3 Nov 2014 11:58:06 +0100 Subject: Make sure to reset all the GSource timer ids Avoids warnings like 'Source ID 8382 was not found when attempting to remove it'. In particular some removals were missing in menuframe.c resulting in a warning being printed every time a submenu was opened. --- openbox/dock.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'openbox/dock.c') diff --git a/openbox/dock.c b/openbox/dock.c index f18683d6..ea9b7f49 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -632,8 +632,6 @@ static gboolean hide_timeout(gpointer data) dock->hidden = TRUE; dock_configure(); - hide_timeout_id = 0; - return FALSE; /* don't repeat */ } @@ -643,30 +641,32 @@ static gboolean show_timeout(gpointer data) dock->hidden = FALSE; dock_configure(); - show_timeout_id = 0; - return FALSE; /* don't repeat */ } +static void destroy_timeout(gpointer data) +{ + gint *id = data; + *id = 0; +} + void dock_hide(gboolean hide) { if (!hide) { if (dock->hidden && config_dock_hide) { show_timeout_id = g_timeout_add_full(G_PRIORITY_DEFAULT, config_dock_show_delay, - show_timeout, NULL, NULL); + show_timeout, &show_timeout_id, destroy_timeout); } else if (!dock->hidden && config_dock_hide && hide_timeout_id) { if (hide_timeout_id) g_source_remove(hide_timeout_id); - hide_timeout_id = 0; } } else { if (!dock->hidden && config_dock_hide) { hide_timeout_id = g_timeout_add_full(G_PRIORITY_DEFAULT, config_dock_hide_delay, - hide_timeout, NULL, NULL); + hide_timeout, &hide_timeout_id, destroy_timeout); } else if (dock->hidden && config_dock_hide && show_timeout_id) { if (show_timeout_id) g_source_remove(show_timeout_id); - show_timeout_id = 0; } } } -- cgit v1.2.3