diff options
| author | vaxerski <vaxry@vaxry.net> | 2023-06-22 21:43:31 +0200 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2023-06-22 21:43:31 +0200 |
| commit | 0283c498d65284478826dcd64837ce2a4bb25bde (patch) | |
| tree | 89d31b9b6bb0a2ef498c04ba95813972f79b0b09 /src/layout/IHyprLayout.cpp | |
| parent | fc59cef1ee573a950c5d5f3bacf1b51142fd56db (diff) | |
xwayland: fix minor force_zero_scaling bugs
Diffstat (limited to 'src/layout/IHyprLayout.cpp')
| -rw-r--r-- | src/layout/IHyprLayout.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 8f256630..2e5b15a4 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -43,8 +43,8 @@ void IHyprLayout::onWindowRemoved(CWindow* pWindow) { pWindow->m_sGroupData.pNextWindow = nullptr; if (pWindow->m_sGroupData.head) { - pWindow->m_sGroupData.head = false; - curr->m_sGroupData.head = true; + pWindow->m_sGroupData.head = false; + curr->m_sGroupData.head = true; curr->m_sGroupData.locked = pWindow->m_sGroupData.locked; pWindow->m_sGroupData.locked = false; } @@ -75,7 +75,9 @@ void IHyprLayout::onWindowRemovedFloating(CWindow* pWindow) { void IHyprLayout::onWindowCreatedFloating(CWindow* pWindow) { wlr_box desiredGeometry = {0}; g_pXWaylandManager->getGeometryForWindow(pWindow, &desiredGeometry); - const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); + const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); + + static auto* const PXWLFORCESCALEZERO = &g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling")->intValue; if (!PMONITOR) { Debug::log(ERR, "Window %lx (%s) has an invalid monitor in onWindowCreatedFloating!!!", pWindow, pWindow->m_szTitle.c_str()); @@ -151,6 +153,11 @@ void IHyprLayout::onWindowCreatedFloating(CWindow* pWindow) { } } + if (*PXWLFORCESCALEZERO && pWindow->m_bIsX11) { + pWindow->m_vRealSize = pWindow->m_vRealSize.goalv() / PMONITOR->scale; + pWindow->m_vRealPosition = pWindow->m_vRealPosition.goalv() / PMONITOR->scale; + } + if (pWindow->m_bX11DoesntWantBorders || (pWindow->m_bIsX11 && pWindow->m_uSurface.xwayland->override_redirect)) { pWindow->m_vRealPosition.setValue(pWindow->m_vRealPosition.goalv()); pWindow->m_vRealSize.setValue(pWindow->m_vRealSize.goalv()); |
