From 9f8c45b449fdb26a19c8ce12389f52936c1aa314 Mon Sep 17 00:00:00 2001 From: Roman Vasiyarov Date: Wed, 17 Sep 2025 17:50:27 +0300 Subject: [PATCH] fix: XWindowsScreen: stop centering panned screens on client when leaving screen panned screens still needs `xtestIsXineramaUnaware` option enabled. this change forcefully uses XTest only when leaving useful examples: * double 1 FullHD screen (main output) by: `xrandr --fb 3840x1080 --output DP-1 --panning 3840x1080+0+0/3840x1000+0+80`, leaving top 80 pixels for moving mouse out without actual panning * dedicate right half of framebuffer to FullHD TV (second output): `xrandr --fb 3840x1080 --output HDMI-0 --panning 1920x1080+1920+0` --- src/lib/platform/XWindowsScreen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/platform/XWindowsScreen.cpp b/src/lib/platform/XWindowsScreen.cpp index c9d6a981a..3b02a2ded 100644 --- a/src/lib/platform/XWindowsScreen.cpp +++ b/src/lib/platform/XWindowsScreen.cpp @@ -328,7 +328,10 @@ void XWindowsScreen::leave() if (m_isPrimary) { warpCursor(m_xCenter, m_yCenter); } else { - fakeMouseMove(m_xCenter, m_yCenter); + // WARN: not using fakeMouseMove() intentionally + // forcibly ignore any xinerama quirks, so that `xrandr --panning ... --tracking ...` works + XTestFakeMotionEvent(m_display, DefaultScreen(m_display), m_xCenter, m_yCenter, CurrentTime); + XFlush(m_display); } // set input context focus to our window