Skip to content

Commit

Permalink
dispatchers: add Fullscreen without sending fullscreen to application (
Browse files Browse the repository at this point in the history
…#4720)

* Add extra option to fullscreen

* Remove useless branch

fixes #1817

---------

Co-authored-by: matteo bob <[email protected]>
  • Loading branch information
epicgamer256705 and matteo4375 authored Feb 17, 2024
1 parent 294e51a commit 289d952
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
21 changes: 11 additions & 10 deletions src/Window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions src/managers/KeybindManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 289d952

Please sign in to comment.