static void menu_entry_frame_free(ObMenuEntryFrame *self);
static void menu_frame_update(ObMenuFrame *self);
static gboolean menu_entry_frame_submenu_timeout(gpointer data);
+static void menu_frame_hide(ObMenuFrame *self);
static Window createWindow(Window parent, gulong mask,
XSetWindowAttributes *attrib)
/* 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, TRUE, OB_CURSOR_POINTER))
+ 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;
}
}
return TRUE;
}
-void menu_frame_hide(ObMenuFrame *self)
+static void menu_frame_hide(ObMenuFrame *self)
{
GList *it = g_list_find(menu_frame_visible, 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);