From e0e1d4ba7e150b215b55029ddbff3c824b94caf7 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 3 May 2007 20:39:26 +0000 Subject: don't show the client menu when its for an invalid window --- openbox/menuframe.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'openbox/menuframe.c') 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); -- cgit v1.2.3