mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-04 13:29:51 -05:00
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.
This commit is contained in:
parent
151ca457b4
commit
e0b6af03ca
1 changed files with 5 additions and 5 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue