From 23ec4793e18949f32c4954b46ff2e724dc1e6f31 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 20 Mar 2022 19:14:17 +0100 Subject: fix xwayland windows grabbing mouse when hidden --- src/Compositor.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index d0b1f2e0..ca36cc5d 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -418,4 +418,21 @@ CWindow* CCompositor::getFirstWindowOnWorkspace(const int& id) { } return nullptr; +} + +void CCompositor::fixXWaylandWindowsOnWorkspace(const int& id) { + const auto ISVISIBLE = isWorkspaceVisible(id); + + for (auto& w : m_lWindows) { + if (w.m_iWorkspaceID == id) { + + // moveXWaylandWindow only moves XWayland windows + // so there is no need to check here + // if the window is XWayland or not. + if (ISVISIBLE) + g_pXWaylandManager->moveXWaylandWindow(&w, w.m_vRealPosition); + else + g_pXWaylandManager->moveXWaylandWindow(&w, Vector2D(42069,42069)); + } + } } \ No newline at end of file -- cgit v1.2.3