Commit 20c78f38 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

xwayland: use get_pointer_device() for enter/leave handling too

In Weston, clicking the window decoration of an Xwayland client gives us a
wl_pointer.button event immediately followed by a wl_pointer.leave event.
The leave event does not contain any button state information, so the button
remains logically down in the DIX.

Once the pointer button is released, a wl_pointer.enter event is sent with
the current button state (zero). This needs to trigger a ButtonRelease event
but for that we need to ensure that the device is the same as the one we send
ButtonPress events through.

Fixes a regression introduced in a4095162

.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
parent dee2bb03
Pipeline #271891 passed with stages
in 6 minutes
......@@ -92,6 +92,15 @@ xwl_pointer_control(DeviceIntPtr device, PtrCtrl *ctrl)
/* Nothing to do, dix handles all settings */
}
static DeviceIntPtr
get_pointer_device(struct xwl_seat *xwl_seat)
{
if (xwl_seat->relative_pointer)
return xwl_seat->relative_pointer;
else
return xwl_seat->pointer;
}
static Bool
init_pointer_buttons(DeviceIntPtr device)
{
......@@ -400,7 +409,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
wl_fixed_t sx_w, wl_fixed_t sy_w)
{
struct xwl_seat *xwl_seat = data;
DeviceIntPtr dev = xwl_seat->pointer;
DeviceIntPtr dev = get_pointer_device(xwl_seat);
DeviceIntPtr master;
int i;
int sx = wl_fixed_to_int(sx_w);
......@@ -475,7 +484,7 @@ pointer_handle_leave(void *data, struct wl_pointer *pointer,
uint32_t serial, struct wl_surface *surface)
{
struct xwl_seat *xwl_seat = data;
DeviceIntPtr dev = xwl_seat->pointer;
DeviceIntPtr dev = get_pointer_device(xwl_seat);
xwl_seat->xwl_screen->serial = serial;
......@@ -595,15 +604,6 @@ pointer_handle_motion(void *data, struct wl_pointer *pointer,
dispatch_pointer_motion_event(xwl_seat);
}
static DeviceIntPtr
get_pointer_device(struct xwl_seat *xwl_seat)
{
if (xwl_seat->relative_pointer)
return xwl_seat->relative_pointer;
else
return xwl_seat->pointer;
}
static void
pointer_handle_button(void *data, struct wl_pointer *pointer, uint32_t serial,
uint32_t time, uint32_t button, uint32_t state)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment