diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-07-04 12:05:25 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2023-07-04 12:05:25 +0200 |
| commit | 18f9fb5e0fdb3fdc1aebe61b3c589bc23aed1e9f (patch) | |
| tree | 74cd33c195e5486a7a998ade7e29c715032d06c8 /src/Compositor.cpp | |
| parent | 6f91997f069a92c23886888e51c27d02d50a6a96 (diff) | |
rules: add stayfocused
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index a9d95f39..b15414e1 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2399,3 +2399,17 @@ void CCompositor::moveWindowToWorkspaceSafe(CWindow* pWindow, CWorkspace* pWorks if (FULLSCREEN) setWindowFullscreen(pWindow, true, FULLSCREENMODE); } + +CWindow* CCompositor::getForceFocus() { + for (auto& w : m_vWindows) { + if (!w->m_bIsMapped || w->isHidden() || !isWorkspaceVisible(w->m_iWorkspaceID)) + continue; + + if (!w->m_bStayFocused) + continue; + + return w.get(); + } + + return nullptr; +} |
