better keyboard window switching

This commit is contained in:
vaxerski
2022-04-13 20:45:06 +02:00
parent a558bcdfbf
commit 158af1eb09
3 changed files with 45 additions and 5 deletions

View File

@@ -649,4 +649,27 @@ void CCompositor::deactivateAllWLRWorkspaces() {
if (w.m_pWlrHandle)
wlr_ext_workspace_handle_v1_set_active(w.m_pWlrHandle, false);
}
}
CWindow* CCompositor::getNextWindowOnWorkspace(CWindow* pWindow) {
bool gotToWindow = false;
for (auto& w : m_lWindows) {
if (&w != pWindow && !gotToWindow)
continue;
if (&w == pWindow) {
gotToWindow = true;
continue;
}
if (w.m_iWorkspaceID == pWindow->m_iWorkspaceID && windowValidMapped(&w))
return &w;
}
for (auto& w : m_lWindows) {
if (&w != pWindow && w.m_iWorkspaceID == pWindow->m_iWorkspaceID && windowValidMapped(&w))
return &w;
}
return nullptr;
}