window.c: Don't ungrab input after displaying the menu
authorKristian Høgsberg <krh@bitplanet.net>
Tue, 29 Oct 2013 05:06:11 +0000 (22:06 -0700)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 29 Oct 2013 05:06:11 +0000 (22:06 -0700)
We used to ungrab first to stop any existing grab and then grab after
showing the menu. That was broken in c680e904897dfb19331f8f296ab, which
moved the ungrab down below the grab, and as a result menus are now
shown without a grab.  This commit moves the grab back up.

clients/window.c

index 331569a..e9acacf 100644 (file)
@@ -4470,6 +4470,8 @@ window_show_menu(struct display *display,
        window->x = x;
        window->y = y;
 
+       input_ungrab(input);
+
        widget_set_redraw_handler(menu->widget, menu_redraw_handler);
        widget_set_enter_handler(menu->widget, menu_enter_handler);
        widget_set_leave_handler(menu->widget, menu_leave_handler);
@@ -4482,7 +4484,6 @@ window_show_menu(struct display *display,
        window_schedule_resize(window, frame_width(menu->frame),
                               frame_height(menu->frame));
 
-       input_ungrab(input);
        frame_interior(menu->frame, &ix, &iy, NULL, NULL);
        wl_shell_surface_set_popup(window->shell_surface, input->seat,
                                   display_get_serial(window->display),