From 91e28bbe9df85e2e94fbcc0137106362aea14ab5 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Tue, 15 Aug 2023 19:15:37 +0200 Subject: xwayland: use a completely separate coordinate system Use a completely separate coordinate system for XWayland. This fixes all issues with force_zero_scaling overlaps. Fixes #2916 --- src/Compositor.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 348ac584..bb1f4f92 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2487,6 +2487,8 @@ void CCompositor::setIdleActivityInhibit(bool enabled) { } void CCompositor::arrangeMonitors() { + static auto* const PXWLFORCESCALEZERO = &g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling")->intValue; + std::vector toArrange; std::vector arranged; @@ -2522,4 +2524,12 @@ void CCompositor::arrangeMonitors() { m->moveTo({maxOffset, 0}); maxOffset += m->vecPosition.x + m->vecSize.x; } + + // reset maxOffset (reuse) + // and set xwayland positions aka auto for all + maxOffset = 0; + for (auto& m : m_vMonitors) { + m->vecXWaylandPosition = {maxOffset, 0}; + maxOffset += (*PXWLFORCESCALEZERO ? m->vecTransformedSize.x : m->vecSize.x); + } } -- cgit v1.2.3