Do not grab display widget

We used to gtk_grab_add() after mouse grab to limit the mouse events
to the display. But it isn't necessary if the display has its own
window, since gdk_pointer_grab() will be limited to it.

Note the widget has the keyboard focus & is focused, so this doesn't
affect keyboard events.

However, this allows application to keep global accelerators
functionning if they want to (like virt-viewer with custom key
bindings).
This commit is contained in:
Marc-André Lureau 2012-03-18 18:38:53 +01:00
parent a01677289c
commit 82a4703fea

View File

@ -364,6 +364,7 @@ static void spice_display_init(SpiceDisplay *display)
GDK_KEY_PRESS_MASK);
gtk_widget_set_double_buffered(widget, false);
gtk_widget_set_can_focus(widget, true);
gtk_widget_set_has_window(widget, true);
d->keycode_map = vnc_display_keymap_gdk2xtkbd_table(&d->keycode_maplen);
d->grabseq = spice_grab_sequence_new_from_string("Control_L+Alt_L");
@ -610,7 +611,6 @@ static GdkGrabStatus do_pointer_grab(SpiceDisplay *display)
ClipCursor(&client_rect);
}
#endif
gtk_grab_add(GTK_WIDGET(display));
#ifdef GDK_WINDOWING_X11
if (status == GDK_GRAB_SUCCESS) {