diff options
| author | Mikael Magnusson <mikachu@gmail.com> | 2014-11-03 11:58:06 +0100 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2014-11-03 12:10:44 +0100 |
| commit | 031e3c13b4333ae8def24f4ccb2f777779d4a3a5 (patch) | |
| tree | d4e751787e6d8e9b8c763673bc9ba2038ac6698e /openbox/dock.c | |
| parent | 69dc27ed779173d0475f11001ea5268087b4b306 (diff) | |
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.
Diffstat (limited to 'openbox/dock.c')
| -rw-r--r-- | openbox/dock.c | 16 |
1 files changed, 8 insertions, 8 deletions
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; } } } |
