feat: add focus to urgent or last window (#1402)

* feat: add focus to urgent or last window

* Rename dispatcher

Co-authored-by: Maxim Baz <git@maximbaz.com>
This commit is contained in:
Cyril Levis 2023-01-21 11:18:55 +01:00 committed by GitHub
parent e811394603
commit fcbfd19393
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 0 deletions

View file

@ -1084,6 +1084,15 @@ int CCompositor::getWindowsOnWorkspace(const int& id) {
return no;
}
CWindow* CCompositor::getUrgentWindow() {
for (auto& w : m_vWindows) {
if (w->m_bIsMapped && w->m_bIsUrgent)
return w.get();
}
return nullptr;
}
bool CCompositor::hasUrgentWindowOnWorkspace(const int& id) {
for (auto& w : m_vWindows) {
if (w->m_iWorkspaceID == id && w->m_bIsMapped && w->m_bIsUrgent)