X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmenuframe.c;h=a95e46fca4e1ccc9bd300037feb7ffed9ad6c196;hb=e0e1d4ba7e150b215b55029ddbff3c824b94caf7;hp=6f8ecad01149b338a38f61d2ae177aebe5ef95ab;hpb=53975abf1220c36ebbab455299a9915477c5a6b8;p=chaz%2Fopenbox diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 6f8ecad0..a95e46fc 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -751,16 +751,6 @@ static gboolean menu_frame_show(ObMenuFrame *self) { GList *it; - if (menu_frame_visible == NULL) { - /* no menus shown yet */ - if (!grab_pointer(TRUE, TRUE, OB_CURSOR_POINTER)) - return FALSE; - if (!grab_keyboard(TRUE)) { - grab_pointer(FALSE, TRUE, OB_CURSOR_POINTER); - return FALSE; - } - } - /* determine if the underlying menu is already visible */ for (it = menu_frame_visible; it; it = g_list_next(it)) { ObMenuFrame *f = it->data; @@ -769,7 +759,18 @@ static gboolean menu_frame_show(ObMenuFrame *self) } if (!it) { if (self->menu->update_func) - self->menu->update_func(self, self->menu->data); + if (!self->menu->update_func(self, self->menu->data)) + return FALSE; + } + + if (menu_frame_visible == NULL) { + /* no menus shown yet */ + if (!grab_pointer(TRUE, TRUE, OB_CURSOR_POINTER)) + return FALSE; + if (!grab_keyboard(TRUE)) { + grab_pointer(FALSE, TRUE, OB_CURSOR_POINTER); + return FALSE; + } } menu_frame_update(self);