diff options
| author | nyx <nnyyxxxx@protonmail.com> | 2025-01-30 16:36:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-30 22:36:42 +0100 |
| commit | ef03f6911694413b1b06aba727ad9ab089a511f7 (patch) | |
| tree | 13dcd7b1ed3d8e3f998e6eceaeadc6ab6527d11e /src/desktop/Window.cpp | |
| parent | 32c0fa2f2fe02254d5887b38cf2cffa72ddfd769 (diff) | |
xwayland: handle window coords correctly (#9238)
Diffstat (limited to 'src/desktop/Window.cpp')
| -rw-r--r-- | src/desktop/Window.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index e59a8d4e..09037cbd 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1706,9 +1706,15 @@ void CWindow::sendWindowSize(Vector2D size, bool force, std::optional<Vector2D> // TODO: this should be decoupled from setWindowSize IMO Vector2D windowPos = overridePos.value_or(m_vRealPosition->goal()); - if (m_bIsX11) { - if (const auto XWAYLANDPOS = g_pXWaylandManager->waylandToXWaylandCoords(windowPos); XWAYLANDPOS != Vector2D{}) - windowPos = XWAYLANDPOS; + if (m_bIsX11 && PMONITOR) { + windowPos -= PMONITOR->vecPosition; + + if (*PXWLFORCESCALEZERO) { + windowPos *= PMONITOR->scale; + size *= PMONITOR->scale; + } + + windowPos += PMONITOR->vecXWaylandPosition; } if (!force && m_vPendingReportedSize == size && (windowPos == m_vReportedPosition || !m_bIsX11)) @@ -1716,13 +1722,10 @@ void CWindow::sendWindowSize(Vector2D size, bool force, std::optional<Vector2D> m_vReportedPosition = windowPos; m_vPendingReportedSize = size; + m_fX11SurfaceScaledBy = 1.0f; - m_fX11SurfaceScaledBy = 1.0f; - - if (*PXWLFORCESCALEZERO && m_bIsX11 && PMONITOR) { - size *= PMONITOR->scale; + if (*PXWLFORCESCALEZERO && m_bIsX11 && PMONITOR) m_fX11SurfaceScaledBy = PMONITOR->scale; - } if (m_bIsX11 && m_pXWaylandSurface) m_pXWaylandSurface->configure({windowPos, size}); |
