X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmenuframe.c;h=09fce0511a7ec6941952b067ecaec64b6351af99;hb=b84a934ab7b3ebd68b8b90961146463ac17d396e;hp=95168d4e7ea908af1d3f947c3ded8044d4719191;hpb=1ee19207fbcf8c0918858d83d04b308ecd6988a7;p=chaz%2Fopenbox diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 95168d4e..09fce051 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -591,6 +591,16 @@ void menu_frame_show(ObMenuFrame *self, ObMenuFrame *parent) if (g_list_find(menu_frame_visible, self)) return; + if (menu_frame_visible == NULL) { + /* no menus shown yet */ + if (!grab_pointer(TRUE, OB_CURSOR_NONE)) + return; + if (!grab_keyboard(TRUE)) { + grab_pointer(FALSE, OB_CURSOR_NONE); + return; + } + } + if (parent) { if (parent->child) menu_frame_hide(parent->child); @@ -598,12 +608,6 @@ void menu_frame_show(ObMenuFrame *self, ObMenuFrame *parent) } self->parent = parent; - if (menu_frame_visible == NULL) { - /* no menus shown yet */ - grab_pointer(TRUE, OB_CURSOR_NONE); - grab_keyboard(TRUE); - } - /* determine if the underlying menu is already visible */ for (it = menu_frame_visible; it; it = g_list_next(it)) { ObMenuFrame *f = it->data;