diff options
| author | Andreas Backx <AndreasBackx@users.noreply.github.com> | 2026-04-05 16:54:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-05 16:54:38 +0100 |
| commit | 8edb7c5663c9aea552074c5d9e36e6f688baf4b7 (patch) | |
| tree | abad473e2ebf0480b50f88af4174eedfcc8de7be /src/desktop/view/Window.cpp | |
| parent | 6983b1906caf31e89d9c92cd04d3b6dc69218bff (diff) | |
xwayland: pipe through monitor in coordinate mapping (#13700)
* xwayland: prefer monitor-aware hover coords
Introduce monitor-aware XWayland coordinate helpers and keep the X11 hover path anchored to the main surface box while preserving detailed debug logging, reducing dependence on nearest-monitor guesses in layout-sensitive input paths.
* xwayland: use window monitor for reported coords
Report X11 window positions through the window's known monitor instead of the generic nearest-monitor heuristic so boundary-aligned outputs keep stable XWayland coordinates.
* xwayland: use window monitor for real position restore
Convert XWayland geometry back into compositor space using the window's current monitor when available so vertically offset layouts do not round-trip through the wrong output.
* xwayland: use window monitor for unmanaged geometry
Restore override-redirect X11 geometry through the window's known monitor so helper windows and popups avoid nearest-monitor misclassification on offset layouts.
* xwayland: remove monitor conversion debug logging
Drop the temporary XWayland hover and coordinate conversion diagnostics now that the monitor-selection bug is confirmed and the window-monitor based conversions fix the issue.
* xwayland: drop unrelated focused-motion change
Remove the exploratory X11-specific pointer focus scaling from InputManager so the monitor mapping fix stays narrowly scoped to the XWayland coordinate conversion changes that actually resolve the bug.
* clang-format XWaylandManager
Diffstat (limited to 'src/desktop/view/Window.cpp')
| -rw-r--r-- | src/desktop/view/Window.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/desktop/view/Window.cpp b/src/desktop/view/Window.cpp index 4506d5fb..57dae3ec 100644 --- a/src/desktop/view/Window.cpp +++ b/src/desktop/view/Window.cpp @@ -1378,7 +1378,7 @@ Vector2D CWindow::realToReportPosition() { if (!m_isX11) return m_realPosition->goal(); - return g_pXWaylandManager->waylandToXWaylandCoords(m_realPosition->goal()); + return g_pXWaylandManager->waylandToXWaylandCoords(m_realPosition->goal(), m_monitor.lock()); } Vector2D CWindow::xwaylandSizeToReal(Vector2D size) { @@ -1392,7 +1392,7 @@ Vector2D CWindow::xwaylandSizeToReal(Vector2D size) { } Vector2D CWindow::xwaylandPositionToReal(Vector2D pos) { - return g_pXWaylandManager->xwaylandToWaylandCoords(pos); + return g_pXWaylandManager->xwaylandToWaylandCoords(pos, m_monitor.lock()); } void CWindow::updateX11SurfaceScale() { @@ -2462,9 +2462,8 @@ void CWindow::unmanagedSetGeometry() { static auto PXWLFORCESCALEZERO = CConfigValue<Hyprlang::INT>("xwayland:force_zero_scaling"); - const auto LOGICALPOS = g_pXWaylandManager->xwaylandToWaylandCoords(m_xwaylandSurface->m_geometry.pos()); - const auto PMONITOR = m_monitor.lock(); + const auto LOGICALPOS = g_pXWaylandManager->xwaylandToWaylandCoords(m_xwaylandSurface->m_geometry.pos(), PMONITOR); const auto XWLSCALE = (*PXWLFORCESCALEZERO && PMONITOR) ? PMONITOR->m_scale : 1.0; const auto LOGICALGEOSIZE = m_xwaylandSurface->m_geometry.size() / XWLSCALE; |
