diff options
| author | nyx <nnyyxxxx@protonmail.com> | 2025-01-31 08:36:56 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-31 14:36:56 +0100 |
| commit | a4b7d1c2d7538068ab4832a66f86801f5f75cc65 (patch) | |
| tree | 1d9407648e362541fac6a04308e344472cb20173 /src/desktop/Window.cpp | |
| parent | 12b5034c99f28025e6c6be29c33bde9f4a24ac9f (diff) | |
xwayland: correct pointer coordinate mismatch in X11 windows (#9259)
refactor(xwayland): add back comments
Diffstat (limited to 'src/desktop/Window.cpp')
| -rw-r--r-- | src/desktop/Window.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index 91c76e7c..0f6bac99 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1697,8 +1697,7 @@ Vector2D CWindow::requestedMaxSize() { void CWindow::sendWindowSize(Vector2D size, bool force, std::optional<Vector2D> overridePos) { static auto PXWLFORCESCALEZERO = CConfigValue<Hyprlang::INT>("xwayland:force_zero_scaling"); - - const auto PMONITOR = m_pMonitor.lock(); + const auto PMONITOR = m_pMonitor.lock(); size = size.clamp(Vector2D{1, 1}, Vector2D{std::numeric_limits<double>::infinity(), std::numeric_limits<double>::infinity()}); @@ -1707,14 +1706,9 @@ void CWindow::sendWindowSize(Vector2D size, bool force, std::optional<Vector2D> Vector2D windowPos = overridePos.value_or(m_vRealPosition->goal()); if (m_bIsX11 && PMONITOR) { - windowPos -= PMONITOR->vecPosition; - - if (*PXWLFORCESCALEZERO) { - windowPos *= PMONITOR->scale; + windowPos = g_pXWaylandManager->waylandToXWaylandCoords(windowPos); + if (*PXWLFORCESCALEZERO) size *= PMONITOR->scale; - } - - windowPos += PMONITOR->vecXWaylandPosition; } if (!force && m_vPendingReportedSize == size && (windowPos == m_vReportedPosition || !m_bIsX11)) |
