mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-15 08:00:33 +01:00
xwayland: Fix incorrect pointer coordinates in enter events
Xwayland was sending incorrect pointer coordinates to X clients on
pointer enter events.
This was caused by calling CheckMotion() with a NULL event, which
prevented the pointer sprite hot coordinates from being updated
properly.
Fix this by constructing a proper DeviceEvent of type ET_Enter in
pointer_handle_enter, initializing it with the current timestamp
and EVENT_SOURCE_FOCUS, and passing it to CheckMotion() instead
of NULL.
This ensures the pointer sprite coordinates are correctly updated
when the pointer enters a window.
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2113>
(cherry picked from commit 7fb5e00ad8)
This commit is contained in:
parent
7f1050de78
commit
b4c5796e4b
1 changed files with 4 additions and 1 deletions
|
|
@ -524,6 +524,7 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
|
|||
int dx, dy;
|
||||
ScreenPtr pScreen = xwl_screen->screen;
|
||||
ValuatorMask mask;
|
||||
DeviceEvent enter;
|
||||
|
||||
/* There's a race here where if we create and then immediately
|
||||
* destroy a surface, we might end up in a state where the Wayland
|
||||
|
|
@ -554,8 +555,10 @@ pointer_handle_enter(void *data, struct wl_pointer *pointer,
|
|||
(*pScreen->SetCursorPosition) (dev, pScreen, dx + sx, dy + sy, TRUE);
|
||||
|
||||
miPointerInvalidateSprite(master);
|
||||
init_device_event(&enter, dev, currentTime.milliseconds, EVENT_SOURCE_FOCUS);
|
||||
enter.type = ET_Enter;
|
||||
|
||||
CheckMotion(NULL, master);
|
||||
CheckMotion(&enter, master);
|
||||
|
||||
/* Ideally, X clients shouldn't see these button releases. When
|
||||
* the pointer leaves a window with buttons down, it means that
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue