diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-09-28 09:24:22 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-09-28 09:24:22 +0000 |
| commit | b8ba1cff1fdd5447984e83708865f8ba6c7f223a (patch) | |
| tree | efaa67047917efc127b4f39c83e3714e03430cf4 /openbox/menuframe.c | |
| parent | ff04a81e62cc9337f89fc913feb29f5295c84217 (diff) | |
perhaps fix problems of being left in menus without being able to control openbox
Diffstat (limited to 'openbox/menuframe.c')
| -rw-r--r-- | openbox/menuframe.c | 16 |
1 files changed, 10 insertions, 6 deletions
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; |
