diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-11 19:51:37 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-11 19:51:37 +0200 |
| commit | a8e872923045eddd314bc26553401a6eb17c57cc (patch) | |
| tree | e8fa6a207b485cebd78f752e7683452000f0be48 /src/Compositor.cpp | |
| parent | b56343133d21622a6187bb1ef8906023ecbc09ef (diff) | |
Added zext_workspace protocol support 🎉
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 319a5eb1..d12cf288 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -90,6 +90,8 @@ CCompositor::CCompositor() { m_sWLRInhibitMgr = wlr_input_inhibit_manager_create(m_sWLDisplay); m_sWLRKbShInhibitMgr = wlr_keyboard_shortcuts_inhibit_v1_create(m_sWLDisplay); + + m_sWLREXTWorkspaceMgr = wlr_ext_workspace_manager_v1_create(m_sWLDisplay); } CCompositor::~CCompositor() { @@ -478,9 +480,9 @@ bool CCompositor::isWorkspaceVisible(const int& w) { return false; } -SWorkspace* CCompositor::getWorkspaceByID(const int& id) { +CWorkspace* CCompositor::getWorkspaceByID(const int& id) { for (auto& w : m_lWorkspaces) { - if (w.ID == id) + if (w.m_iID == id) return &w; } @@ -489,8 +491,9 @@ SWorkspace* CCompositor::getWorkspaceByID(const int& id) { void CCompositor::sanityCheckWorkspaces() { for (auto it = m_lWorkspaces.begin(); it != m_lWorkspaces.end(); ++it) { - if (getWindowsOnWorkspace(it->ID) == 0 && !isWorkspaceVisible(it->ID)) + if (getWindowsOnWorkspace(it->m_iID) == 0 && !isWorkspaceVisible(it->m_iID)) { it = m_lWorkspaces.erase(it); + } } } @@ -524,7 +527,7 @@ void CCompositor::fixXWaylandWindowsOnWorkspace(const int& id) { // moveXWaylandWindow only moves XWayland windows // so there is no need to check here // if the window is XWayland or not. - if (ISVISIBLE && (!PWORKSPACE->hasFullscreenWindow || w.m_bIsFullscreen)) + if (ISVISIBLE && (!PWORKSPACE->m_bHasFullscreenWindow || w.m_bIsFullscreen)) g_pXWaylandManager->moveXWaylandWindow(&w, w.m_vRealPosition); else g_pXWaylandManager->moveXWaylandWindow(&w, Vector2D(42069,42069)); @@ -633,4 +636,11 @@ CWindow* CCompositor::getWindowInDirection(CWindow* pWindow, char dir) { return longestIntersectWindow; return nullptr; +} + +void CCompositor::deactivateAllWLRWorkspaces() { + for (auto& w : m_lWorkspaces) { + if (w.m_pWlrHandle) + wlr_ext_workspace_handle_v1_set_active(w.m_pWlrHandle, false); + } }
\ No newline at end of file |
