diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-26 12:12:29 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-06-26 12:12:29 +0200 |
| commit | 78bf88ba607d0efff0e270bc16562e2081a34037 (patch) | |
| tree | d7e82a710fbdbf05ab780f73ef8f39d7494023d3 /src/layout | |
| parent | 29aab210333d69fb94cf8ec4a0f60582bc336721 (diff) | |
Added fullscreen rule
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/DwindleLayout.cpp | 9 | ||||
| -rw-r--r-- | src/layout/DwindleLayout.hpp | 2 | ||||
| -rw-r--r-- | src/layout/IHyprLayout.hpp | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index aeaf8c6b..c72dbb99 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -676,21 +676,24 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { g_pCompositor->moveWindowToTop(pWindow); } -void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreenMode fullscreenMode) { +void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreenMode fullscreenMode, bool on) { if (!g_pCompositor->windowValidMapped(pWindow)) return; + if (on == pWindow->m_bIsFullscreen) + return; // ignore + const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(pWindow->m_iWorkspaceID); - if (PWORKSPACE->m_bHasFullscreenWindow && !pWindow->m_bIsFullscreen) { + if (PWORKSPACE->m_bHasFullscreenWindow && on) { // if the window wants to be fullscreen but there already is one, // ignore the request. return; } // otherwise, accept it. - pWindow->m_bIsFullscreen = !pWindow->m_bIsFullscreen; + pWindow->m_bIsFullscreen = on; PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow; if (!pWindow->m_bIsFullscreen) { diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp index 55c123ae..3f32ff0b 100644 --- a/src/layout/DwindleLayout.hpp +++ b/src/layout/DwindleLayout.hpp @@ -53,7 +53,7 @@ public: virtual void onEndDragWindow(); virtual void onMouseMove(const Vector2D&); virtual void onWindowCreatedFloating(CWindow*); - virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode); + virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode, bool); virtual std::any layoutMessage(SLayoutMessageHeader, std::string); virtual SWindowRenderLayoutHints requestRenderHints(CWindow*); virtual void switchWindows(CWindow*, CWindow*); diff --git a/src/layout/IHyprLayout.hpp b/src/layout/IHyprLayout.hpp index a7268301..d7102761 100644 --- a/src/layout/IHyprLayout.hpp +++ b/src/layout/IHyprLayout.hpp @@ -84,7 +84,7 @@ public: The layout sets all the fullscreen flags. It can either accept or ignore. */ - virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode) = 0; + virtual void fullscreenRequestForWindow(CWindow*, eFullscreenMode, bool) = 0; /* Called when a dispatcher requests a custom message |
