From 289d952a6ee02f6d54a0899870bbec52ff9a53df Mon Sep 17 00:00:00 2001 From: epicgamer256705 <86577845+epicgamer256705@users.noreply.github.com> Date: Sat, 17 Feb 2024 11:21:06 -0500 Subject: [PATCH] dispatchers: add Fullscreen without sending fullscreen to application (#4720) * Add extra option to fullscreen * Remove useless branch fixes #1817 --------- Co-authored-by: matteo bob --- src/Window.cpp | 2 +- src/Window.hpp | 21 +++++++++++---------- src/managers/KeybindManager.cpp | 3 +++ 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/Window.cpp b/src/Window.cpp index 1a7b9de9..75a45d8f 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -1064,7 +1064,7 @@ bool CWindow::canBeTorn() { bool CWindow::shouldSendFullscreenState() { const auto MODE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID)->m_efFullscreenMode; - return m_bFakeFullscreenState || (m_bIsFullscreen && (MODE == FULLSCREEN_FULL)); + return m_bDontSendFullscreen ? false : (m_bFakeFullscreenState || (m_bIsFullscreen && (MODE == FULLSCREEN_FULL))); } void CWindow::setSuspended(bool suspend) { diff --git a/src/Window.hpp b/src/Window.hpp index 38eb857c..f8ba4180 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -240,16 +240,17 @@ class CWindow { bool m_bIsPseudotiled = false; Vector2D m_vPseudoSize = Vector2D(0, 0); - bool m_bFirstMap = false; // for layouts - bool m_bIsFloating = false; - bool m_bDraggingTiled = false; // for dragging around tiled windows - bool m_bIsFullscreen = false; - bool m_bWasMaximized = false; - uint64_t m_iMonitorID = -1; - std::string m_szTitle = ""; - std::string m_szInitialTitle = ""; - std::string m_szInitialClass = ""; - int m_iWorkspaceID = -1; + bool m_bFirstMap = false; // for layouts + bool m_bIsFloating = false; + bool m_bDraggingTiled = false; // for dragging around tiled windows + bool m_bIsFullscreen = false; + bool m_bDontSendFullscreen = false; + bool m_bWasMaximized = false; + uint64_t m_iMonitorID = -1; + std::string m_szTitle = ""; + std::string m_szInitialTitle = ""; + std::string m_szInitialClass = ""; + int m_iWorkspaceID = -1; bool m_bIsMapped = false; diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 8e7418fb..9c56d557 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -964,6 +964,9 @@ void CKeybindManager::fullscreenActive(std::string args) { if (g_pCompositor->isWorkspaceSpecial(PWINDOW->m_iWorkspaceID)) return; + PWINDOW->m_bDontSendFullscreen = false; + if (args == "2") + PWINDOW->m_bDontSendFullscreen = true; g_pCompositor->setWindowFullscreen(PWINDOW, !PWINDOW->m_bIsFullscreen, args == "1" ? FULLSCREEN_MAXIMIZED : FULLSCREEN_FULL); }