diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 4ddac879..0672a543 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2148,14 +2148,16 @@ void CCompositor::setWindowFullscreen(CWindow* pWindow, bool on, eFullscreenMode const auto PWORKSPACE = getWorkspaceByID(pWindow->m_iWorkspaceID); + const auto MODE = mode == FULLSCREEN_INVALID ? PWORKSPACE->m_efFullscreenMode : mode; + if (PWORKSPACE->m_bHasFullscreenWindow && on) { Debug::log(LOG, "Rejecting fullscreen ON on a fullscreen workspace"); return; } - g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(pWindow, mode, on); + g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(pWindow, MODE, on); - g_pXWaylandManager->setWindowFullscreen(pWindow, pWindow->m_bIsFullscreen && mode == FULLSCREEN_FULL); + g_pXWaylandManager->setWindowFullscreen(pWindow, pWindow->m_bIsFullscreen && MODE == FULLSCREEN_FULL); pWindow->updateDynamicRules(); updateWindowAnimatedDecorationValues(pWindow); diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index d0ae4ae8..f726b224 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -263,13 +263,6 @@ void Events::listener_mapWindow(void* owner, void* data) { PWINDOW->applyDynamicRule(r); } - CWindow* pFullscreenWindow = nullptr; - if (PWORKSPACE->m_bHasFullscreenWindow && !PWINDOW->m_bIsFloating) { - const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); - pFullscreenWindow = PFULLWINDOW; - g_pCompositor->setWindowFullscreen(PFULLWINDOW, false, PWORKSPACE->m_efFullscreenMode); - } - PWINDOW->updateSpecialRenderData(); // disallow tiled pinned @@ -543,10 +536,6 @@ void Events::listener_mapWindow(void* owner, void* data) { } } - if (pFullscreenWindow && workspaceSilent) { - g_pCompositor->setWindowFullscreen(pFullscreenWindow, true, PWORKSPACE->m_efFullscreenMode); - } - // recheck idle inhibitors g_pInputManager->recheckIdleInhibitorStatus(); diff --git a/src/helpers/Workspace.hpp b/src/helpers/Workspace.hpp index 07b5694c..2e810b9a 100644 --- a/src/helpers/Workspace.hpp +++ b/src/helpers/Workspace.hpp @@ -4,9 +4,10 @@ #include #include "../defines.hpp" -enum eFullscreenMode : uint8_t +enum eFullscreenMode : int8_t { - FULLSCREEN_FULL = 0, + FULLSCREEN_INVALID = -1, + FULLSCREEN_FULL = 0, FULLSCREEN_MAXIMIZED }; diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index fae4af52..1ce47d96 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -291,13 +291,6 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection dire return; } - const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID); - - if (PWORKSPACE->m_bHasFullscreenWindow) { - const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); - g_pCompositor->setWindowFullscreen(PFULLWINDOW, false, FULLSCREEN_FULL); - } - // last fail-safe to avoid duplicate fullscreens if ((!OPENINGON || OPENINGON->pWindow == pWindow) && getNodesOnWorkspace(PNODE->workspaceID) > 1) { for (auto& node : m_lDwindleNodesData) { @@ -481,8 +474,8 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection dire NEWPARENT->recalcSizePosRecursive(false, horizontalOverride, verticalOverride); - applyNodeDataToWindow(PNODE); - applyNodeDataToWindow(OPENINGON); + recalculateMonitor(pWindow->m_iMonitorID); + pWindow->applyGroupRules(); } diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp index 993f8cb7..47818536 100644 --- a/src/layout/DwindleLayout.hpp +++ b/src/layout/DwindleLayout.hpp @@ -9,7 +9,7 @@ #include class CHyprDwindleLayout; -enum eFullscreenMode : uint8_t; +enum eFullscreenMode : int8_t; struct SDwindleNodeData { SDwindleNodeData* pParent = nullptr; diff --git a/src/layout/IHyprLayout.hpp b/src/layout/IHyprLayout.hpp index 15acbc1d..32f95a22 100644 --- a/src/layout/IHyprLayout.hpp +++ b/src/layout/IHyprLayout.hpp @@ -13,9 +13,10 @@ struct SLayoutMessageHeader { CWindow* pWindow = nullptr; }; -enum eFullscreenMode : uint8_t; +enum eFullscreenMode : int8_t; -enum eRectCorner { +enum eRectCorner +{ CORNER_NONE = 0, CORNER_TOPLEFT, CORNER_TOPRIGHT, @@ -23,9 +24,10 @@ enum eRectCorner { CORNER_BOTTOMLEFT }; -enum eDirection { +enum eDirection +{ DIRECTION_DEFAULT = -1, - DIRECTION_UP = 0, + DIRECTION_UP = 0, DIRECTION_RIGHT, DIRECTION_DOWN, DIRECTION_LEFT diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index c1dd37dc..624ded2a 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -167,13 +167,6 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection direc } } - const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID); - - if (PWORKSPACE->m_bHasFullscreenWindow) { - const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); - g_pCompositor->setWindowFullscreen(PFULLWINDOW, false, FULLSCREEN_FULL); - } - // recalc recalculateMonitor(pWindow->m_iMonitorID); } diff --git a/src/layout/MasterLayout.hpp b/src/layout/MasterLayout.hpp index aa201505..f220bd7b 100644 --- a/src/layout/MasterLayout.hpp +++ b/src/layout/MasterLayout.hpp @@ -7,10 +7,11 @@ #include #include -enum eFullscreenMode : uint8_t; +enum eFullscreenMode : int8_t; //orientation determines which side of the screen the master area resides -enum eOrientation : uint8_t { +enum eOrientation : uint8_t +{ ORIENTATION_LEFT = 0, ORIENTATION_TOP, ORIENTATION_RIGHT,