diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-05-08 01:31:16 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-05-08 01:31:22 +0100 |
| commit | 5e7925eaeba474cfc283e26b7aa3426ec97424f7 (patch) | |
| tree | b8cca3a9dc57c52dffc3acbe58dc3f86fe54b15a /src/desktop | |
| parent | 57a12476deef1b3e9967896cd8b3676131193865 (diff) | |
foreign-toplevel: bypass no activate focus checks
ref #5939
those are used by focus switchers so they should bypass stuff like focus_on_activate = false
Diffstat (limited to 'src/desktop')
| -rw-r--r-- | src/desktop/Window.cpp | 4 | ||||
| -rw-r--r-- | src/desktop/Window.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp index 00066b27..e9e50a56 100644 --- a/src/desktop/Window.cpp +++ b/src/desktop/Window.cpp @@ -1274,7 +1274,7 @@ std::unordered_map<std::string, std::string> CWindow::getEnv() { return results; } -void CWindow::activate() { +void CWindow::activate(bool force) { static auto PFOCUSONACTIVATE = CConfigValue<Hyprlang::INT>("misc:focus_on_activate"); g_pEventManager->postEvent(SHyprIPCEvent{"urgent", std::format("{:x}", (uintptr_t)this)}); @@ -1282,7 +1282,7 @@ void CWindow::activate() { m_bIsUrgent = true; - if (!*PFOCUSONACTIVATE || (m_eSuppressedEvents & SUPPRESS_ACTIVATE_FOCUSONLY) || (m_eSuppressedEvents & SUPPRESS_ACTIVATE)) + if (!force && (!*PFOCUSONACTIVATE || (m_eSuppressedEvents & SUPPRESS_ACTIVATE_FOCUSONLY) || (m_eSuppressedEvents & SUPPRESS_ACTIVATE))) return; if (m_bIsFloating) diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp index 40e5db49..ed79c896 100644 --- a/src/desktop/Window.hpp +++ b/src/desktop/Window.hpp @@ -422,7 +422,7 @@ class CWindow { bool visibleOnMonitor(CMonitor* pMonitor); int workspaceID(); bool onSpecialWorkspace(); - void activate(); + void activate(bool force = false); int getRealBorderSize(); void updateSpecialRenderData(); |
