diff options
author | vaxerski <[email protected]> | 2022-08-25 16:47:28 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-08-25 16:47:33 +0200 |
commit | de477a6ff589479e6ae8773ea5da097d7d0fdce5 (patch) | |
tree | fd7ac48b63fd944a8d9d3bc30ca12dfb6eaf51e8 | |
parent | e92469121d37af387cb7fa507ae6ac6225cb9ebc (diff) | |
download | Hyprland-de477a6ff589479e6ae8773ea5da097d7d0fdce5.tar.gz Hyprland-de477a6ff589479e6ae8773ea5da097d7d0fdce5.zip |
don't focus silent windows
-rw-r--r-- | src/events/Windows.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 0bb06f63..fbaadd51 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -108,6 +108,7 @@ void Events::listener_mapWindow(void* owner, void* data) { std::string requestedWorkspace = ""; bool workspaceSilent = false; bool requestsFullscreen = PWINDOW->m_bWantsInitialFullscreen || (!PWINDOW->m_bIsX11 && PWINDOW->m_uSurface.xdg->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL && PWINDOW->m_uSurface.xdg->toplevel->requested.fullscreen); + bool shouldFocus = true; for (auto& r : WINDOWRULES) { if (r.szRule.find("monitor") == 0) { @@ -188,10 +189,14 @@ void Events::listener_mapWindow(void* owner, void* data) { // check for silent if (requestedWorkspace.contains("silent")) { workspaceSilent = true; + shouldFocus = false; } requestedWorkspace = requestedWorkspace.substr(0, requestedWorkspace.find_first_of(' ')); + if (!shouldFocus && requestedWorkspace == std::to_string(PMONITOR->activeWorkspace)) + shouldFocus = true; + if (requestedWorkspace == "special") { workspaceSilent = true; } @@ -262,7 +267,7 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_vPseudoSize = PWINDOW->m_vRealSize.goalv() - Vector2D(10,10); } - if (!PWINDOW->m_bNoFocus && !PWINDOW->m_bNoInitialFocus && PWINDOW->m_iX11Type != 2) { + if (!PWINDOW->m_bNoFocus && !PWINDOW->m_bNoInitialFocus && PWINDOW->m_iX11Type != 2 && shouldFocus) { g_pCompositor->focusWindow(PWINDOW); PWINDOW->m_fActiveInactiveAlpha.setValueAndWarp(*PACTIVEALPHA); } else |