diff options
author | Rob Bradford <rob@linux.intel.com> | 2012-01-09 16:00:14 +0000 |
---|---|---|
committer | Rob Bradford <rob@linux.intel.com> | 2012-01-09 16:00:14 +0000 |
commit | eedd1ec92f6c035c00f4deaef748173f0ed36f06 (patch) | |
tree | 6e5ac6417af97942134ad2d512f83ff3d90612bc /gdk | |
parent | e5283122fd0796fc351fbd809a064ff5fed4698b (diff) | |
download | gtk+-eedd1ec92f6c035c00f4deaef748173f0ed36f06.tar.gz |
wayland: Make the resize and move functions use gdk_device_ungrab
Now that grab and ungrab vfuncs are implemented on GdkDevice then we can use
gdk_device_ungrab to break the implicit grab created by the button press that
triggered the resize and move.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/wayland/gdkwindow-wayland.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index dec633842d..5da8b28269 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -1147,9 +1147,6 @@ gdk_wayland_window_begin_resize_drag (GdkWindow *window, { GdkWindowImplWayland *impl; uint32_t grab_type; - GdkDeviceGrabInfo *button_implicit_grab; - gulong serial; - GdkDisplay *display; if (GDK_WINDOW_DESTROYED (window) || !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window)) @@ -1197,28 +1194,14 @@ gdk_wayland_window_begin_resize_drag (GdkWindow *window, impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - wl_shell_surface_resize(impl->shell_surface, - _gdk_wayland_device_get_device (device), - timestamp, grab_type); + wl_shell_surface_resize (impl->shell_surface, + _gdk_wayland_device_get_device (device), + timestamp, grab_type); - /* We need to break the implicit grab that we created with the button press. - * This is because of the semantics on wl_shell_surface_resize. That will - * absorb all the events until the resize is completed by the compositor. - * This includes the release event that would ordinarily remove the implicit - * grab. + /* This is needed since Wayland will absorb all the pointer events after the + * above function - FIXME: Is this always safe..? */ - display = gdk_window_get_display (window); - serial = _gdk_display_get_next_serial (display); - button_implicit_grab = - _gdk_display_has_device_grab (display, device, serial); - - if (button_implicit_grab && - button_implicit_grab->implicit) - { - button_implicit_grab->serial_end = serial; - button_implicit_grab->implicit_ungrab = FALSE; - _gdk_display_device_grab_update (display, device, device, serial); - } + gdk_device_ungrab (device, timestamp); } static void @@ -1238,8 +1221,13 @@ gdk_wayland_window_begin_move_drag (GdkWindow *window, impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - wl_shell_surface_move(impl->shell_surface, - _gdk_wayland_device_get_device (device), timestamp); + wl_shell_surface_move (impl->shell_surface, + _gdk_wayland_device_get_device (device), timestamp); + + /* This is needed since Wayland will absorb all the pointer events after the + * above function - FIXME: Is this always safe..? + */ + gdk_device_ungrab (device, timestamp); } static void |