diff --git a/src/Window.hpp b/src/Window.hpp index caf00ab7..3ef33414 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -10,8 +10,7 @@ #include "helpers/Vector2D.hpp" #include "helpers/WLSurface.hpp" -enum eIdleInhibitMode -{ +enum eIdleInhibitMode { IDLEINHIBIT_NONE = 0, IDLEINHIBIT_ALWAYS, IDLEINHIBIT_FULLSCREEN, @@ -226,9 +225,10 @@ class CWindow { bool m_bNoFocus = false; bool m_bNoInitialFocus = false; - // initial fullscreen and fullscreen disabled + // Fullscreen and Maximize bool m_bWantsInitialFullscreen = false; bool m_bNoFullscreenRequest = false; + bool m_bNoMaximizeRequest = false; SSurfaceTreeNode* m_pSurfaceTree = nullptr; diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index b99a3ae9..0fd165cd 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -881,8 +881,8 @@ bool windowRuleValid(const std::string& RULE) { return !(RULE != "float" && RULE != "tile" && RULE.find("opacity") != 0 && RULE.find("move") != 0 && RULE.find("size") != 0 && RULE.find("minsize") != 0 && RULE.find("maxsize") != 0 && RULE.find("pseudo") != 0 && RULE.find("monitor") != 0 && RULE.find("idleinhibit") != 0 && RULE != "nofocus" && RULE != "noblur" && RULE != "noshadow" && RULE != "nodim" && RULE != "noborder" && RULE != "center" && RULE != "opaque" && RULE != "forceinput" && RULE != "fullscreen" && - RULE != "nofullscreenrequest" && RULE != "fakefullscreen" && RULE != "nomaxsize" && RULE != "pin" && RULE != "noanim" && RULE != "dimaround" && - RULE != "windowdance" && RULE != "maximize" && RULE.find("animation") != 0 && RULE.find("rounding") != 0 && RULE.find("workspace") != 0 && + RULE != "nofullscreenrequest" && RULE != "nomaximizerequest" && RULE != "fakefullscreen" && RULE != "nomaxsize" && RULE != "pin" && RULE != "noanim" && + RULE != "dimaround" && RULE != "windowdance" && RULE != "maximize" && RULE.find("animation") != 0 && RULE.find("rounding") != 0 && RULE.find("workspace") != 0 && RULE.find("bordercolor") != 0 && RULE != "forcergbx" && RULE != "noinitialfocus" && RULE != "stayfocused" && RULE.find("bordersize") != 0); } diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 56e8de25..4c901356 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -109,6 +109,8 @@ void Events::listener_mapWindow(void* owner, void* data) { (PWINDOW->m_bIsX11 && PWINDOW->m_uSurface.xwayland->fullscreen); bool requestsFakeFullscreen = false; bool requestsMaximize = false; + bool overridingNoFullscreen = false; + bool overridingNoMaximize = false; bool shouldFocus = true; bool workspaceSpecial = false; @@ -176,8 +178,11 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_bNoInitialFocus = true; } else if (r.szRule.find("nofullscreenrequest") == 0) { PWINDOW->m_bNoFullscreenRequest = true; + } else if (r.szRule.find("nomaximizerequest") == 0) { + PWINDOW->m_bNoMaximizeRequest = true; } else if (r.szRule == "fullscreen") { - requestsFullscreen = true; + requestsFullscreen = true; + overridingNoFullscreen = true; } else if (r.szRule == "fakefullscreen") { requestsFakeFullscreen = true; } else if (r.szRule == "windowdance") { @@ -189,7 +194,8 @@ void Events::listener_mapWindow(void* owner, void* data) { } else if (r.szRule == "pin") { PWINDOW->m_bPinned = true; } else if (r.szRule == "maximize") { - requestsMaximize = true; + requestsMaximize = true; + overridingNoMaximize = true; } else if (r.szRule == "stayfocused") { PWINDOW->m_bStayFocused = true; } else if (r.szRule.find("idleinhibit") == 0) { @@ -485,7 +491,8 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_vRealPosition.setCallbackOnEnd(setAnimToMove); PWINDOW->m_vRealSize.setCallbackOnEnd(setAnimToMove); - if ((requestsFullscreen || requestsMaximize || requestsFakeFullscreen) && !PWINDOW->m_bNoFullscreenRequest) { + if ((requestsFullscreen && (!PWINDOW->m_bNoFullscreenRequest || overridingNoFullscreen)) || (requestsMaximize && (!PWINDOW->m_bNoMaximizeRequest || overridingNoMaximize)) || + requestsFakeFullscreen) { // fix fullscreen on requested (basically do a switcheroo) if (PWORKSPACE->m_bHasFullscreenWindow) { const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); @@ -496,6 +503,8 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->m_bFakeFullscreenState = !PWINDOW->m_bFakeFullscreenState; g_pXWaylandManager->setWindowFullscreen(PWINDOW, true); } else { + overridingNoFullscreen = false; + overridingNoMaximize = false; PWINDOW->m_vRealPosition.warp(); PWINDOW->m_vRealSize.warp(); g_pCompositor->setWindowFullscreen(PWINDOW, true, requestsFullscreen ? FULLSCREEN_FULL : FULLSCREEN_MAXIMIZED); @@ -1125,7 +1134,7 @@ void Events::listener_NewXDGDeco(wl_listener* listener, void* data) { void Events::listener_requestMaximize(void* owner, void* data) { const auto PWINDOW = (CWindow*)owner; - if (PWINDOW->m_bNoFullscreenRequest) + if (PWINDOW->m_bNoMaximizeRequest) return; Debug::log(LOG, "Maximize request for %lx", PWINDOW);