X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fmenuframe.c;h=68ea49496a992b29750b70665f79b2dff84abaf8;hb=3ddc053ccd6087a54e8a150aad43cb457d7b199f;hp=a42c138da1bca9722d907f07a5a8b959ccef27f2;hpb=c2e4d42e6d086b60d4ecd9ef2e51ef9ed7575dfc;p=chaz%2Fopenbox diff --git a/openbox/menuframe.c b/openbox/menuframe.c index a42c138d..68ea4949 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -911,10 +911,13 @@ static gboolean menu_frame_show(ObMenuFrame *self) if (menu_frame_visible == NULL) { /* no menus shown yet */ - if (!grab_pointer(TRUE, TRUE, OB_CURSOR_POINTER)) + + /* grab the pointer in such a way as to pass through "owner events" + so that we can get enter/leave notifies in the menu. */ + if (!grab_pointer(TRUE, FALSE, OB_CURSOR_POINTER)) return FALSE; - if (!grab_keyboard(TRUE)) { - grab_pointer(FALSE, TRUE, OB_CURSOR_POINTER); + if (!grab_keyboard()) { + ungrab_pointer(); return FALSE; } } @@ -1032,8 +1035,8 @@ void menu_frame_hide(ObMenuFrame *self) if (menu_frame_visible == NULL) { /* last menu shown */ - grab_pointer(FALSE, TRUE, OB_CURSOR_NONE); - grab_keyboard(FALSE); + ungrab_pointer(); + ungrab_keyboard(); } XUnmapWindow(ob_display, self->window);