diff options
| author | Vaxry <vaxry@vaxry.net> | 2023-11-05 16:21:47 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2023-11-05 16:21:47 +0000 |
| commit | 55825c301e5f437566e042d7036bc29a2e48257b (patch) | |
| tree | f8a0707fe22345df459c99f79c986d24097246d8 /src/Compositor.cpp | |
| parent | d8b7ded18c47e5e10d21ac162a42256d573a9e91 (diff) | |
compositor: allow windowfromregex floating param
fixes #3766
Diffstat (limited to 'src/Compositor.cpp')
| -rw-r--r-- | src/Compositor.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 4f655c16..fc45496e 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2350,6 +2350,19 @@ CWindow* CCompositor::getWindowByRegex(const std::string& regexp) { } else if (regexp.starts_with("pid:")) { mode = MODE_PID; matchCheck = regexp.substr(4); + } else if (regexp.starts_with("floating")) { + // first floating on the current ws + if (!m_pLastWindow) + return nullptr; + + for (auto& w : m_vWindows) { + if (!w->m_bIsMapped || !w->m_bIsFloating || w->m_iWorkspaceID != m_pLastWindow->m_iWorkspaceID || w->isHidden()) + continue; + + return w.get(); + } + + return nullptr; } for (auto& w : g_pCompositor->m_vWindows) { |
