From aab8d228f7a1ae7e118070eec9e76a8fa7ebea17 Mon Sep 17 00:00:00 2001 From: Stanislav Aleksandrov Date: Mon, 22 Dec 2025 16:02:26 +0000 Subject: [PATCH] xwayland: remove limits for wayland pointer This change helps when an X11 window receives pointer events into the part of the window that is out of screen bounds. Example: 1. window is located at -50,-50 (root) 2. receives absolute pointer event at 10,10 (surface local), 3. it is then translated to -40,-40 (root coordinates) 4. then clamped to the screen geometry and becomes 0,0 5. 0,0 (root) is translated to window local: 50,50 This patch effectively removes those limits and the window will get the Enter/Motion events at 10,10(local) and -40,-40(root) as expected. --- hw/xwayland/xwayland-screen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index 22c500801..5b0d5aceb 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -861,6 +861,13 @@ xwl_screen_update_global_surface_scale(struct xwl_screen *xwl_screen) return (xwl_screen->global_surface_scale != old_scale); } +static void +xwl_screen_cursor_no_limits(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, + BoxPtr pHotBox, BoxPtr pTopLeftBox) { + pTopLeftBox->x1 = pTopLeftBox->y1 = INT16_MIN; + pTopLeftBox->x2 = pTopLeftBox->y2 = INT16_MAX; +} + Bool xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) { @@ -1170,6 +1177,9 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv) pScreen->CursorWarpedTo = xwl_cursor_warped_to; pScreen->CursorConfinedTo = xwl_cursor_confined_to; + pScreen->CursorLimits = xwl_screen_cursor_no_limits; + pScreen->ConstrainCursorHarder = NULL; + xwl_screen->allow_commits_prop = MakeAtom(allow_commits, strlen(allow_commits), TRUE);