From b814ba98a7c74e29afe4e5e543ee6d0283a67d67 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 2 Oct 2023 16:27:32 +0100 Subject: misc: add misc:new_window_takes_over_fullscreen referenced in #3474 --- src/events/Windows.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 2ea4e46c..b870f01d 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -46,6 +46,7 @@ void Events::listener_mapWindow(void* owner, void* data) { static auto* const PSWALLOW = &g_pConfigManager->getConfigValuePtr("misc:enable_swallow")->intValue; static auto* const PSWALLOWREGEX = &g_pConfigManager->getConfigValuePtr("misc:swallow_regex")->strValue; static auto* const PSWALLOWEXREGEX = &g_pConfigManager->getConfigValuePtr("misc:swallow_exception_regex")->strValue; + static auto* const PNEWTAKESOVERFS = &g_pConfigManager->getConfigValuePtr("misc:new_window_takes_over_fullscreen")->intValue; auto PMONITOR = g_pCompositor->m_pLastMonitor; const auto PWORKSPACE = @@ -467,8 +468,12 @@ void Events::listener_mapWindow(void* owner, void* data) { const auto PLSFROMFOCUS = g_pCompositor->getLayerSurfaceFromSurface(g_pCompositor->m_pLastFocus); if (PLSFROMFOCUS && PLSFROMFOCUS->layerSurface->current.keyboard_interactive) PWINDOW->m_bNoInitialFocus = true; - if (PWORKSPACE->m_bHasFullscreenWindow && !requestsFullscreen) - PWINDOW->m_bNoInitialFocus = true; + if (PWORKSPACE->m_bHasFullscreenWindow && !requestsFullscreen) { + if (*PNEWTAKESOVERFS == 0) + PWINDOW->m_bNoInitialFocus = true; + else + requestsFullscreen = true; + } if (!PWINDOW->m_bNoFocus && !PWINDOW->m_bNoInitialFocus && (PWINDOW->m_iX11Type != 2 || (PWINDOW->m_bIsX11 && wlr_xwayland_or_surface_wants_focus(PWINDOW->m_uSurface.xwayland))) && !workspaceSilent && -- cgit v1.2.3