summaryrefslogtreecommitdiff
path: root/src/managers/XWaylandManager.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2023-12-17 19:58:11 +0000
committerVaxry <vaxry@vaxry.net>2023-12-17 19:58:11 +0000
commitbf7374011b17776137c6cadb016695ef05926c6c (patch)
tree1a9b721193d6e0ddd6cba6b6191f4f37a06d2e9f /src/managers/XWaylandManager.cpp
parent8c9f38e40500720d4de5881d62ec43625e9680ea (diff)
xwaylandmgr: allow resizes without a monitor
Diffstat (limited to 'src/managers/XWaylandManager.cpp')
-rw-r--r--src/managers/XWaylandManager.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 2883f205..c384e6cc 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -150,14 +150,12 @@ void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, Vector2D size, bool f
static auto* const PXWLFORCESCALEZERO = &g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling")->intValue;
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
- if (!PMONITOR)
- return;
// calculate pos
// TODO: this should be decoupled from setWindowSize IMO
Vector2D windowPos = pWindow->m_vRealPosition.vec();
- if (pWindow->m_bIsX11) {
+ if (pWindow->m_bIsX11 && PMONITOR) {
windowPos = windowPos - PMONITOR->vecPosition; // normalize to monitor
if (*PXWLFORCESCALEZERO)
windowPos = windowPos * PMONITOR->scale; // scale if applicable
@@ -172,11 +170,9 @@ void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, Vector2D size, bool f
pWindow->m_fX11SurfaceScaledBy = 1.f;
- if (*PXWLFORCESCALEZERO && pWindow->m_bIsX11) {
- if (const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); PMONITOR) {
- size = size * PMONITOR->scale;
- pWindow->m_fX11SurfaceScaledBy = PMONITOR->scale;
- }
+ if (*PXWLFORCESCALEZERO && pWindow->m_bIsX11 && PMONITOR) {
+ size = size * PMONITOR->scale;
+ pWindow->m_fX11SurfaceScaledBy = PMONITOR->scale;
}
if (pWindow->m_bIsX11)