aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVaxry <[email protected]>2023-11-05 19:57:11 +0000
committerVaxry <[email protected]>2023-11-05 19:57:23 +0000
commitecf98069f655a4e54943ec70d638ddcf429211d1 (patch)
tree753018d7ac8819944e6762da856999a13053ea3a
parent0476e1b498265f12d719da522a615c19241a076d (diff)
downloadHyprland-ecf98069f655a4e54943ec70d638ddcf429211d1.tar.gz
Hyprland-ecf98069f655a4e54943ec70d638ddcf429211d1.zip
layout: round window boxes after special scale factor
fixes #3761 again
-rw-r--r--src/layout/DwindleLayout.cpp9
-rw-r--r--src/layout/MasterLayout.cpp9
2 files changed, 12 insertions, 6 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index eed06751..6602c758 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -207,10 +207,13 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
// if special, we adjust the coords a bit
static auto* const PSCALEFACTOR = &g_pConfigManager->getConfigValuePtr("dwindle:special_scale_factor")->floatValue;
- PWINDOW->m_vRealPosition = calcPos + (calcSize - calcSize * *PSCALEFACTOR) / 2.f;
- PWINDOW->m_vRealSize = calcSize * *PSCALEFACTOR;
+ CBox wb = {calcPos + (calcSize - calcSize * *PSCALEFACTOR) / 2.f, calcSize * *PSCALEFACTOR};
+ wb.round(); // avoid rounding mess
- g_pXWaylandManager->setWindowSize(PWINDOW, calcSize * *PSCALEFACTOR);
+ PWINDOW->m_vRealPosition = wb.pos();
+ PWINDOW->m_vRealSize = wb.size();
+
+ g_pXWaylandManager->setWindowSize(PWINDOW, wb.size());
} else {
PWINDOW->m_vRealSize = calcSize;
PWINDOW->m_vRealPosition = calcPos;
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index 46a05aa8..e29addfd 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -692,10 +692,13 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
if (g_pCompositor->isWorkspaceSpecial(PWINDOW->m_iWorkspaceID)) {
static auto* const PSCALEFACTOR = &g_pConfigManager->getConfigValuePtr("master:special_scale_factor")->floatValue;
- PWINDOW->m_vRealPosition = calcPos + (calcSize - calcSize * *PSCALEFACTOR) / 2.f;
- PWINDOW->m_vRealSize = calcSize * *PSCALEFACTOR;
+ CBox wb = {calcPos + (calcSize - calcSize * *PSCALEFACTOR) / 2.f, calcSize * *PSCALEFACTOR};
+ wb.round(); // avoid rounding mess
- g_pXWaylandManager->setWindowSize(PWINDOW, calcSize * *PSCALEFACTOR);
+ PWINDOW->m_vRealPosition = wb.pos();
+ PWINDOW->m_vRealSize = wb.size();
+
+ g_pXWaylandManager->setWindowSize(PWINDOW, wb.size());
} else {
PWINDOW->m_vRealSize = calcSize;
PWINDOW->m_vRealPosition = calcPos;