summaryrefslogtreecommitdiff
path: root/src/managers
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-06-11 21:52:13 +0200
committervaxerski <vaxry@vaxry.net>2023-06-11 21:52:13 +0200
commit6beb79f27b84c36b8b9ef5476d861a94a9071009 (patch)
tree54860720b2a564141c1127cb53746a423b5fcda7 /src/managers
parent64ce06a3536898ddae7146e8f649361ce081c8d6 (diff)
xwayland: add force_zero_scaling
Diffstat (limited to 'src/managers')
-rw-r--r--src/managers/XWaylandManager.cpp11
-rw-r--r--src/managers/input/InputManager.cpp3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 7cd03b3a..1801247d 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -148,6 +148,17 @@ void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, Vector2D size, bool f
pWindow->m_vReportedPosition = pWindow->m_vRealPosition.vec();
pWindow->m_vReportedSize = size;
+ static auto* const PXWLFORCESCALEZERO = &g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling")->intValue;
+
+ 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 (pWindow->m_bIsX11)
wlr_xwayland_surface_configure(pWindow->m_uSurface.xwayland, pWindow->m_vRealPosition.vec().x, pWindow->m_vRealPosition.vec().y, size.x, size.y);
else
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 9f72603f..9dd6e5da 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -330,6 +330,9 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
surfaceLocal = mouseCoords - surfacePos + Vector2D(geom.x, geom.y);
}
+ if (pFoundWindow && pFoundWindow->m_bIsX11) // for x11 force scale zero
+ surfaceLocal = surfaceLocal * pFoundWindow->m_fX11SurfaceScaledBy;
+
bool allowKeyboardRefocus = true;
if (*PHOGFOCUS && !refocus && g_pCompositor->m_pLastFocus) {