diff options
author | Neil Roberts <neil@linux.intel.com> | 2012-01-12 15:48:02 +0000 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-01-12 10:59:07 -0500 |
commit | e0b6af03cad9cb970072f39d602c85be6b4b014b (patch) | |
tree | 78c66fab6b78e9e79300d712bbdd43e5356fa386 /src | |
parent | 151ca457b4384c385c0062716b55595e22fef7ea (diff) |
server: In default grab, update focus resource after sending release
The default grab implementation in wayland-server was updating the
focus resource before sending the button event. This would cause the
button release to be dropped from the implicit grab if the pointer is
moved away from the focus surface. This patch just swaps the order
around.
Diffstat (limited to 'src')
-rw-r--r-- | src/wayland-server.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wayland-server.c b/src/wayland-server.c index 514afb2..70adf28 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -445,17 +445,17 @@ default_grab_button(struct wl_grab *grab, struct wl_input_device *device = grab->input_device; struct wl_resource *resource; + resource = device->pointer_focus_resource; + if (resource) + wl_resource_post_event(resource, WL_INPUT_DEVICE_BUTTON, + time, button, state); + if (device->button_count == 0 && state == 0) wl_input_device_set_pointer_focus(device, device->current, time, device->x, device->y, device->current_x, device->current_y); - - resource = device->pointer_focus_resource; - if (resource) - wl_resource_post_event(resource, WL_INPUT_DEVICE_BUTTON, - time, button, state); } static const struct wl_grab_interface default_grab_interface = { |