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.
Mikael Magnusson mikachu@gmail.com
5 files changed,
34 insertions(+),
25 deletions(-)
M
openbox/dock.c
→
openbox/dock.c
@@ -632,8 +632,6 @@ /* hide */
dock->hidden = TRUE; dock_configure(); - hide_timeout_id = 0; - return FALSE; /* don't repeat */ }@@ -643,30 +641,32 @@ /* show */
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; } } }
M
openbox/event.c
→
openbox/event.c
@@ -2122,6 +2122,7 @@ event_curserial = d->serial;
if (client_focus(d->client) && config_focus_raise) stacking_raise(CLIENT_AS_WINDOW(d->client)); event_curtime = old; + return FALSE; /* no repeat */ }@@ -2134,6 +2135,7 @@ event_curtime = d->time;
event_curserial = d->serial; focus_nothing(); event_curtime = old; + return FALSE; /* no repeat */ }
M
openbox/frame.c
→
openbox/frame.c
@@ -1666,6 +1666,8 @@ ObFrame *self = data;
if (self->focused != self->flash_on) frame_adjust_focus(self, self->focused); + + self->flash_timer = 0; } static gboolean flash_timeout(gpointer data)@@ -1787,14 +1789,12 @@
XMoveResizeWindow(obt_display, self->window, x, y, w, h); XFlush(obt_display); - if (time == 0) - frame_end_iconify_animation(self); - return time > 0; /* repeat until we're out of time */ } -void frame_end_iconify_animation(ObFrame *self) +void frame_end_iconify_animation(gpointer data) { + ObFrame *self = data; /* see if there is an animation going */ if (self->iconify_animation_going == 0) return;@@ -1811,6 +1811,7 @@ }
/* we're not animating any more ! */ self->iconify_animation_going = 0; + self->iconify_animation_timer = 0; XMoveResizeWindow(obt_display, self->window, self->area.x, self->area.y,@@ -1861,7 +1862,8 @@ g_source_remove(self->iconify_animation_timer);
self->iconify_animation_timer = g_timeout_add_full(G_PRIORITY_DEFAULT, FRAME_ANIMATE_ICONIFY_STEP_TIME, - frame_animate_iconify, self, NULL); + frame_animate_iconify, self, + frame_end_iconify_animation); /* do the first step */
M
openbox/frame.h
→
openbox/frame.h
@@ -265,7 +265,7 @@ /*! Start an animation for iconifying or restoring a frame. The callback
will be called when the animation finishes. But if another animation is started in the meantime, the callback will never get called. */ void frame_begin_iconify_animation(ObFrame *self, gboolean iconifying); -void frame_end_iconify_animation(ObFrame *self); +void frame_end_iconify_animation(gpointer data); #define frame_iconify_animating(f) (f->iconify_animation_going != 0)