aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMightyPlaza <[email protected]>2024-07-31 17:55:52 +0000
committerGitHub <[email protected]>2024-07-31 19:55:52 +0200
commite989a0bcffac81092ed2a7e371f5225c113f689d (patch)
treec4a92933b863fde9ab0cee4e3f993f543596258c
parent8a5f9bbb394ddeb4be9a9df6248b41b07d84ea66 (diff)
downloadHyprland-e989a0bcffac81092ed2a7e371f5225c113f689d.tar.gz
Hyprland-e989a0bcffac81092ed2a7e371f5225c113f689d.zip
internal: refactor fullscreen states (#7104)
* refactor fullscreen modified: src/Compositor.cpp modified: src/Compositor.hpp modified: src/config/ConfigManager.cpp modified: src/config/ConfigManager.hpp modified: src/debug/HyprCtl.cpp modified: src/desktop/LayerSurface.cpp modified: src/desktop/Window.cpp modified: src/desktop/Window.hpp modified: src/desktop/Workspace.cpp modified: src/desktop/Workspace.hpp modified: src/events/Windows.cpp modified: src/helpers/Monitor.cpp modified: src/layout/DwindleLayout.cpp modified: src/layout/DwindleLayout.hpp modified: src/layout/IHyprLayout.cpp modified: src/layout/IHyprLayout.hpp modified: src/layout/MasterLayout.cpp modified: src/layout/MasterLayout.hpp modified: src/managers/KeybindManager.cpp modified: src/managers/KeybindManager.hpp modified: src/managers/input/IdleInhibitor.cpp modified: src/managers/input/InputManager.cpp modified: src/managers/input/Swipe.cpp modified: src/protocols/ForeignToplevelWlr.cpp modified: src/render/Renderer.cpp modified: src/render/decorations/CHyprGroupBarDecoration.cpp * clean up modified: src/config/ConfigManager.cpp modified: src/debug/HyprCtl.cpp modified: src/desktop/Window.hpp modified: src/desktop/Workspace.cpp modified: src/events/Windows.cpp modified: src/managers/KeybindManager.cpp modified: src/managers/input/Swipe.cpp * fix mapWindow fullscreen modified: src/events/Windows.cpp * fix typo modified: src/desktop/Workspace.cpp * add fullscreenstate modified: src/config/ConfigManager.cpp modified: src/events/Windows.cpp * change syncFullscreen to lower modified: src/config/ConfigManager.hpp * initialize fs state modified: src/desktop/Window.hpp
-rw-r--r--src/Compositor.cpp112
-rw-r--r--src/Compositor.hpp6
-rw-r--r--src/config/ConfigManager.cpp10
-rw-r--r--src/config/ConfigManager.hpp1
-rw-r--r--src/debug/HyprCtl.cpp13
-rw-r--r--src/desktop/LayerSurface.cpp2
-rw-r--r--src/desktop/Window.cpp40
-rw-r--r--src/desktop/Window.hpp43
-rw-r--r--src/desktop/Workspace.cpp9
-rw-r--r--src/desktop/Workspace.hpp9
-rw-r--r--src/events/Windows.cpp99
-rw-r--r--src/helpers/Monitor.cpp2
-rw-r--r--src/layout/DwindleLayout.cpp76
-rw-r--r--src/layout/DwindleLayout.hpp2
-rw-r--r--src/layout/IHyprLayout.cpp14
-rw-r--r--src/layout/IHyprLayout.hpp2
-rw-r--r--src/layout/MasterLayout.cpp76
-rw-r--r--src/layout/MasterLayout.hpp2
-rw-r--r--src/managers/KeybindManager.cpp81
-rw-r--r--src/managers/KeybindManager.hpp2
-rw-r--r--src/managers/input/IdleInhibitor.cpp2
-rw-r--r--src/managers/input/InputManager.cpp8
-rw-r--r--src/managers/input/Swipe.cpp2
-rw-r--r--src/protocols/ForeignToplevelWlr.cpp12
-rw-r--r--src/render/Renderer.cpp24
-rw-r--r--src/render/decorations/CHyprGroupBarDecoration.cpp2
26 files changed, 323 insertions, 328 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index f6e418de..97355d2c 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -1206,7 +1206,7 @@ PHLWINDOW CCompositor::getWindowFromHandle(uint32_t handle) {
PHLWINDOW CCompositor::getFullscreenWindowOnWorkspace(const int& ID) {
for (auto& w : m_vWindows) {
- if (w->workspaceID() == ID && w->m_bIsFullscreen)
+ if (w->workspaceID() == ID && w->isFullscreen())
return w;
}
@@ -1494,7 +1494,7 @@ PHLWINDOW CCompositor::getWindowInDirection(PHLWINDOW pWindow, char dir) {
if (!PMONITOR)
return nullptr; // ??
- const auto WINDOWIDEALBB = pWindow->m_bIsFullscreen ? CBox{PMONITOR->vecPosition, PMONITOR->vecSize} : pWindow->getWindowIdealBoundingBoxIgnoreReserved();
+ const auto WINDOWIDEALBB = pWindow->isFullscreen() ? CBox{PMONITOR->vecPosition, PMONITOR->vecSize} : pWindow->getWindowIdealBoundingBoxIgnoreReserved();
const auto POSA = Vector2D(WINDOWIDEALBB.x, WINDOWIDEALBB.y);
const auto SIZEA = Vector2D(WINDOWIDEALBB.width, WINDOWIDEALBB.height);
@@ -1507,13 +1507,13 @@ PHLWINDOW CCompositor::getWindowInDirection(PHLWINDOW pWindow, char dir) {
// for tiled windows, we calc edges
for (auto& w : m_vWindows) {
- if (w == pWindow || !w->m_bIsMapped || w->isHidden() || (!w->m_bIsFullscreen && w->m_bIsFloating) || !isWorkspaceVisible(w->m_pWorkspace))
+ if (w == pWindow || !w->m_bIsMapped || w->isHidden() || (!w->isFullscreen() && w->m_bIsFloating) || !isWorkspaceVisible(w->m_pWorkspace))
continue;
if (pWindow->m_iMonitorID == w->m_iMonitorID && pWindow->m_pWorkspace != w->m_pWorkspace)
continue;
- if (PWORKSPACE->m_bHasFullscreenWindow && !w->m_bIsFullscreen && !w->m_bCreatedOverFullscreen)
+ if (PWORKSPACE->m_bHasFullscreenWindow && !w->isFullscreen() && !w->m_bCreatedOverFullscreen)
continue;
if (!*PMONITORFALLBACK && pWindow->m_iMonitorID != w->m_iMonitorID)
@@ -1599,13 +1599,13 @@ PHLWINDOW CCompositor::getWindowInDirection(PHLWINDOW pWindow, char dir) {
constexpr float THRESHOLD = 0.3 * M_PI;
for (auto& w : m_vWindows) {
- if (w == pWindow || !w->m_bIsMapped || w->isHidden() || (!w->m_bIsFullscreen && !w->m_bIsFloating) || !isWorkspaceVisible(w->m_pWorkspace))
+ if (w == pWindow || !w->m_bIsMapped || w->isHidden() || (!w->isFullscreen() && !w->m_bIsFloating) || !isWorkspaceVisible(w->m_pWorkspace))
continue;
if (pWindow->m_iMonitorID == w->m_iMonitorID && pWindow->m_pWorkspace != w->m_pWorkspace)
continue;
- if (PWORKSPACE->m_bHasFullscreenWindow && !w->m_bIsFullscreen && !w->m_bCreatedOverFullscreen)
+ if (PWORKSPACE->m_bHasFullscreenWindow && !w->isFullscreen() && !w->m_bCreatedOverFullscreen)
continue;
if (!*PMONITORFALLBACK && pWindow->m_iMonitorID != w->m_iMonitorID)
@@ -1887,7 +1887,7 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) {
// opacity
const auto PWORKSPACE = pWindow->m_pWorkspace;
- if (pWindow->m_bIsFullscreen && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) {
+ if (pWindow->isEffectiveInternalFSMode(FSMODE_FULLSCREEN)) {
pWindow->m_fActiveInactiveAlpha = pWindow->m_sWindowData.alphaFullscreen.valueOrDefault().applyAlpha(*PFULLSCREENALPHA);
} else {
if (pWindow == m_pLastWindow)
@@ -1957,7 +1957,7 @@ void CCompositor::swapActiveWorkspaces(CMonitor* pMonitorA, CMonitor* pMonitorB)
if (w->m_bIsFloating)
w->m_vRealPosition = w->m_vRealPosition.goal() - pMonitorA->vecPosition + pMonitorB->vecPosition;
- if (w->m_bIsFullscreen) {
+ if (w->isFullscreen()) {
w->m_vRealPosition = pMonitorB->vecPosition;
w->m_vRealSize = pMonitorB->vecSize;
}
@@ -1982,7 +1982,7 @@ void CCompositor::swapActiveWorkspaces(CMonitor* pMonitorA, CMonitor* pMonitorB)
if (w->m_bIsFloating)
w->m_vRealPosition = w->m_vRealPosition.goal() - pMonitorB->vecPosition + pMonitorA->vecPosition;
- if (w->m_bIsFullscreen) {
+ if (w->isFullscreen()) {
w->m_vRealPosition = pMonitorA->vecPosition;
w->m_vRealSize = pMonitorA->vecSize;
}
@@ -2159,7 +2159,7 @@ void CCompositor::moveWorkspaceToMonitor(PHLWORKSPACE pWorkspace, CMonitor* pMon
if (w->m_bIsFloating)
w->m_vRealPosition = w->m_vRealPosition.goal() - POLDMON->vecPosition + pMonitor->vecPosition;
- if (w->m_bIsFullscreen) {
+ if (w->isFullscreen()) {
w->m_vRealPosition = pMonitor->vecPosition;
w->m_vRealSize = pMonitor->vecSize;
}
@@ -2234,12 +2234,12 @@ void CCompositor::updateFullscreenFadeOnWorkspace(PHLWORKSPACE pWorkspace) {
for (auto& w : g_pCompositor->m_vWindows) {
if (w->m_pWorkspace == pWorkspace) {
- if (w->m_bFadingOut || w->m_bPinned || w->m_bIsFullscreen)
+ if (w->m_bFadingOut || w->m_bPinned || w->isFullscreen())
continue;
if (!FULLSCREEN)
w->m_fAlpha = 1.f;
- else if (!w->m_bIsFullscreen)
+ else if (!w->isFullscreen())
w->m_fAlpha = !w->m_bCreatedOverFullscreen ? 0.f : 1.f;
}
}
@@ -2249,54 +2249,86 @@ void CCompositor::updateFullscreenFadeOnWorkspace(PHLWORKSPACE pWorkspace) {
if (pWorkspace->m_iID == PMONITOR->activeWorkspaceID() || pWorkspace->m_iID == PMONITOR->activeSpecialWorkspaceID()) {
for (auto& ls : PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]) {
if (!ls->fadingOut)
- ls->alpha = FULLSCREEN && pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL ? 0.f : 1.f;
+ ls->alpha = FULLSCREEN && pWorkspace->m_efFullscreenMode == FSMODE_FULLSCREEN ? 0.f : 1.f;
}
}
}
-void CCompositor::setWindowFullscreen(PHLWINDOW pWindow, bool on, eFullscreenMode mode) {
+void CCompositor::changeWindowFullscreenModeInternal(const PHLWINDOW PWINDOW, const eFullscreenMode MODE, const bool ON) {
+ setWindowFullscreenInternal(
+ PWINDOW, (eFullscreenMode)(ON ? (uint8_t)PWINDOW->m_sFullscreenState.internal | (uint8_t)MODE : ((uint8_t)PWINDOW->m_sFullscreenState.internal & (uint8_t)~MODE)));
+}
+
+void CCompositor::changeWindowFullscreenModeClient(const PHLWINDOW PWINDOW, const eFullscreenMode MODE, const bool ON) {
+ setWindowFullscreenClient(PWINDOW,
+ (eFullscreenMode)(ON ? (uint8_t)PWINDOW->m_sFullscreenState.client | (uint8_t)MODE : ((uint8_t)PWINDOW->m_sFullscreenState.client & (uint8_t)~MODE)));
+}
+
+void CCompositor::setWindowFullscreenInternal(const PHLWINDOW PWINDOW, const eFullscreenMode MODE) {
+ if (PWINDOW->m_sWindowData.syncFullscreen.valueOrDefault())
+ setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = MODE, .client = MODE});
+ else
+ setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = MODE, .client = PWINDOW->m_sFullscreenState.client});
+}
+
+void CCompositor::setWindowFullscreenClient(const PHLWINDOW PWINDOW, const eFullscreenMode MODE) {
+ if (PWINDOW->m_sWindowData.syncFullscreen.valueOrDefault())
+ setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = MODE, .client = MODE});
+ else
+ setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = PWINDOW->m_sFullscreenState.internal, .client = MODE});
+}
+
+void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, sFullscreenState state) {
static auto PNODIRECTSCANOUT = CConfigValue<Hyprlang::INT>("misc:no_direct_scanout");
- if (!validMapped(pWindow) || g_pCompositor->m_bUnsafeState)
+ if (!validMapped(PWINDOW) || g_pCompositor->m_bUnsafeState)
return;
- if (pWindow->m_bPinned) {
- Debug::log(LOG, "Pinned windows cannot be fullscreen'd");
- return;
- }
+ state.internal = std::clamp(state.internal, (eFullscreenMode)0, FSMODE_MAX);
+ state.client = std::clamp(state.client, (eFullscreenMode)0, FSMODE_MAX);
- if (pWindow->m_bIsFullscreen == on) {
- Debug::log(LOG, "Window is already in the required fullscreen state");
- return;
- }
+ const auto PMONITOR = getMonitorFromID(PWINDOW->m_iMonitorID);
+ const auto PWORKSPACE = PWINDOW->m_pWorkspace;
- const auto PMONITOR = getMonitorFromID(pWindow->m_iMonitorID);
+ const eFullscreenMode CURRENT_EFFECTIVE_MODE = (eFullscreenMode)std::bit_floor((uint8_t)PWINDOW->m_sFullscreenState.internal);
+ const eFullscreenMode EFFECTIVE_MODE = (eFullscreenMode)std::bit_floor((uint8_t)state.internal);
- const auto PWORKSPACE = pWindow->m_pWorkspace;
+ const bool CHANGEINTERNAL = !(PWINDOW->m_bPinned || CURRENT_EFFECTIVE_MODE == EFFECTIVE_MODE || (PWORKSPACE->m_bHasFullscreenWindow && !PWINDOW->isFullscreen()));
- const auto MODE = mode == FULLSCREEN_INVALID ? PWORKSPACE->m_efFullscreenMode : mode;
+ // TODO: update the state on syncFullscreen changes
+ if (!CHANGEINTERNAL && PWINDOW->m_sWindowData.syncFullscreen.valueOrDefault())
+ return;
- if (PWORKSPACE->m_bHasFullscreenWindow && on) {
- Debug::log(LOG, "Rejecting fullscreen ON on a fullscreen workspace");
+ PWINDOW->m_sFullscreenState.client = state.client;
+ g_pXWaylandManager->setWindowFullscreen(PWINDOW, state.client & FSMODE_FULLSCREEN);
+
+ if (!CHANGEINTERNAL)
return;
- }
- g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(pWindow, MODE, on);
+ g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(PWINDOW, CURRENT_EFFECTIVE_MODE, EFFECTIVE_MODE);
- g_pXWaylandManager->setWindowFullscreen(pWindow, pWindow->shouldSendFullscreenState());
+ PWINDOW->m_sFullscreenState.internal = state.internal;
+ PWORKSPACE->m_efFullscreenMode = EFFECTIVE_MODE;
+ PWORKSPACE->m_bHasFullscreenWindow = EFFECTIVE_MODE != FSMODE_NONE;
- updateWindowAnimatedDecorationValues(pWindow);
+ g_pEventManager->postEvent(SHyprIPCEvent{"fullscreen", std::to_string((int)EFFECTIVE_MODE != FSMODE_NONE)});
+ EMIT_HOOK_EVENT("fullscreen", PWINDOW);
+
+ g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PWINDOW->m_iMonitorID);
+ PWINDOW->updateWindowDecos();
+ updateWindowAnimatedDecorationValues(PWINDOW);
// make all windows on the same workspace under the fullscreen window
for (auto& w : m_vWindows) {
- if (w->m_pWorkspace == PWORKSPACE && !w->m_bIsFullscreen && !w->m_bFadingOut && !w->m_bPinned)
+ if (w->m_pWorkspace == PWORKSPACE && !w->isFullscreen() && !w->m_bFadingOut && !w->m_bPinned)
w->m_bCreatedOverFullscreen = false;
}
+
updateFullscreenFadeOnWorkspace(PWORKSPACE);
- g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goal(), true);
+ g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goal(), true);
- forceReportSizesToWindowsOnWorkspace(pWindow->workspaceID());
+ forceReportSizesToWindowsOnWorkspace(PWINDOW->workspaceID());
g_pInputManager->recheckIdleInhibitorStatus();
@@ -2307,7 +2339,7 @@ void CCompositor::setWindowFullscreen(PHLWINDOW pWindow, bool on, eFullscreenMod
// send a scanout tranche if we are entering fullscreen, and send a regular one if we aren't.
// ignore if DS is disabled.
if (!*PNODIRECTSCANOUT)
- g_pHyprRenderer->setSurfaceScanoutMode(pWindow->m_pWLSurface->resource(), on ? PMONITOR->self.lock() : nullptr);
+ g_pHyprRenderer->setSurfaceScanoutMode(PWINDOW->m_pWLSurface->resource(), EFFECTIVE_MODE != FSMODE_NONE ? PMONITOR->self.lock() : nullptr);
g_pConfigManager->ensureVRR(PMONITOR);
}
@@ -2639,11 +2671,11 @@ void CCompositor::moveWindowToWorkspaceSafe(PHLWINDOW pWindow, PHLWORKSPACE pWor
if (pWindow->m_bPinned && pWorkspace->m_bIsSpecialWorkspace)
return;
- const bool FULLSCREEN = pWindow->m_bIsFullscreen;
- const auto FULLSCREENMODE = pWindow->m_pWorkspace->m_efFullscreenMode;
+ const bool FULLSCREEN = pWindow->isFullscreen();
+ const auto FULLSCREENMODE = pWindow->m_sFullscreenState.internal;
if (FULLSCREEN)
- setWindowFullscreen(pWindow, false, FULLSCREEN_FULL);
+ setWindowFullscreenInternal(pWindow, FSMODE_NONE);
if (!pWindow->m_bIsFloating) {
g_pLayoutManager->getCurrentLayout()->onWindowRemovedTiling(pWindow);
@@ -2676,7 +2708,7 @@ void CCompositor::moveWindowToWorkspaceSafe(PHLWINDOW pWindow, PHLWORKSPACE pWor
}
if (FULLSCREEN)
- setWindowFullscreen(pWindow, true, FULLSCREENMODE);
+ setWindowFullscreenInternal(pWindow, FULLSCREENMODE);
g_pCompositor->updateWorkspaceWindows(pWorkspace->m_iID);
g_pCompositor->updateWorkspaceWindows(pWindow->workspaceID());
diff --git a/src/Compositor.hpp b/src/Compositor.hpp
index da390b44..295935c4 100644
--- a/src/Compositor.hpp
+++ b/src/Compositor.hpp
@@ -146,7 +146,11 @@ class CCompositor {
void swapActiveWorkspaces(CMonitor*, CMonitor*);
CMonitor* getMonitorFromString(const std::string&);
bool workspaceIDOutOfBounds(const int64_t&);
- void setWindowFullscreen(PHLWINDOW, bool, eFullscreenMode mode = FULLSCREEN_INVALID);
+ void setWindowFullscreenInternal(const PHLWINDOW PWINDOW, const eFullscreenMode MODE);
+ void setWindowFullscreenClient(const PHLWINDOW PWINDOW, const eFullscreenMode MODE);
+ void setWindowFullscreenState(const PHLWINDOW PWINDOW, const sFullscreenState state);
+ void changeWindowFullscreenModeInternal(const PHLWINDOW PWINDOW, const eFullscreenMode MODE, const bool ON);
+ void changeWindowFullscreenModeClient(const PHLWINDOW PWINDOW, const eFullscreenMode MODE, const bool ON);
void updateFullscreenFadeOnWorkspace(PHLWORKSPACE);
PHLWINDOW getX11Parent(PHLWINDOW);
void scheduleFrameForMonitor(CMonitor*, Aquamarine::IOutput::scheduleFrameReason reason = Aquamarine::IOutput::AQ_SCHEDULE_CLIENT_UNKNOWN);
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 65eab579..fe3af8c0 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -1100,7 +1100,7 @@ std::vector<SWindowRule> CConfigManager::getMatchingRules(PHLWINDOW pWindow, boo
// since some rules will be applied later, we need to store some flags
bool hasFloating = pWindow->m_bIsFloating;
- bool hasFullscreen = pWindow->m_bIsFullscreen;
+ bool hasFullscreen = pWindow->isFullscreen();
// local tags for dynamic tag rule match
auto tags = pWindow->m_tags;
@@ -1448,7 +1448,7 @@ void CConfigManager::ensureVRR(CMonitor* pMonitor) {
if (!PWORKSPACE)
return; // ???
- const auto WORKSPACEFULL = PWORKSPACE->m_bHasFullscreenWindow && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL;
+ const auto WORKSPACEFULL = PWORKSPACE->m_bHasFullscreenWindow && (PWORKSPACE->m_efFullscreenMode & FSMODE_FULLSCREEN);
if (WORKSPACEFULL) {
m->output->state->setAdaptiveSync(true);
@@ -2099,11 +2099,11 @@ std::optional<std::string> CConfigManager::handleUnbind(const std::string& comma
bool windowRuleValid(const std::string& RULE) {
static const auto rules = std::unordered_set<std::string>{
- "fakefullscreen", "float", "fullscreen", "maximize", "noinitialfocus", "pin", "stayfocused", "tile",
+ "float", "fullscreen", "maximize", "noinitialfocus", "pin", "stayfocused", "tile",
};
static const auto rulesPrefix = std::vector<std::string>{
- "animation", "bordercolor", "bordersize", "center", "group", "idleinhibit", "maxsize", "minsize", "monitor", "move",
- "opacity", "plugin:", "pseudo", "rounding", "size", "suppressevent", "tag", "workspace", "xray",
+ "animation", "bordercolor", "bordersize", "center", "fullscreenstate", "group", "idleinhibit", "maxsize", "minsize", "monitor",
+ "move", "opacity", "plugin:", "pseudo", "rounding", "size", "suppressevent", "tag", "workspace", "xray",
};
const auto VALS = CVarList(RULE, 2, ' ');
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp
index 454a12c0..75dea9ef 100644
--- a/src/config/ConfigManager.hpp
+++ b/src/config/ConfigManager.hpp
@@ -182,6 +182,7 @@ class CConfigManager {
{"noshortcutsinhibit", [](PHLWINDOW pWindow) { return &pWindow->m_sWindowData.noShortcutsInhibit; }},
{"opaque", [](PHLWINDOW pWindow) { return &pWindow->m_sWindowData.opaque; }},
{"forcergbx", [](PHLWINDOW pWindow) { return &pWindow->m_sWindowData.RGBX; }},
+ {"syncfullscreen", [](PHLWINDOW pWindow) { return &pWindow->m_sWindowData.syncFullscreen; }},
{"immediate", [](PHLWINDOW pWindow) { return &pWindow->m_sWindowData.tearing; }},
{"xray", [](PHLWINDOW pWindow) { return &pWindow->m_sWindowData.xray; }},
};
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp
index d89d1772..cf873e6c 100644
--- a/src/debug/HyprCtl.cpp
+++ b/src/debug/HyprCtl.cpp
@@ -240,8 +240,7 @@ std::string CHyprCtl::getWindowData(PHLWINDOW w, eHyprCtlOutputFormat format) {
"xwayland": {},
"pinned": {},
"fullscreen": {},
- "fullscreenMode": {},
- "fakeFullscreen": {},
+ "fullscreenClient": {},
"grouped": [{}],
"tags": [{}],
"swallowing": "0x{:x}",
@@ -252,19 +251,19 @@ std::string CHyprCtl::getWindowData(PHLWINDOW w, eHyprCtlOutputFormat format) {
escapeJSONStrings(!w->m_pWorkspace ? "" : w->m_pWorkspace->m_szName), ((int)w->m_bIsFloating == 1 ? "true" : "false"), (w->m_bIsPseudotiled ? "true" : "false"),
(int64_t)w->m_iMonitorID, escapeJSONStrings(w->m_szClass), escapeJSONStrings(w->m_szTitle), escapeJSONStrings(w->m_szInitialClass),
escapeJSONStrings(w->m_szInitialTitle), w->getPID(), ((int)w->m_bIsX11 == 1 ? "true" : "false"), (w->m_bPinned ? "true" : "false"),
- (w->m_bIsFullscreen ? "true" : "false"), (w->m_bIsFullscreen ? (w->m_pWorkspace ? (int)w->m_pWorkspace->m_efFullscreenMode : 0) : 0),
- w->m_bFakeFullscreenState ? "true" : "false", getGroupedData(w, format), getTagsData(w, format), (uintptr_t)w->m_pSwallowed.lock().get(), getFocusHistoryID(w));
+ (uint8_t)w->m_sFullscreenState.internal, (uint8_t)w->m_sFullscreenState.client, getGroupedData(w, format), getTagsData(w, format),
+ (uintptr_t)w->m_pSwallowed.lock().get(), getFocusHistoryID(w));
} else {
return std::format(
"Window {:x} -> {}:\n\tmapped: {}\n\thidden: {}\n\tat: {},{}\n\tsize: {},{}\n\tworkspace: {} ({})\n\tfloating: {}\n\tpseudo: {}\n\tmonitor: {}\n\tclass: {}\n\ttitle: "
"{}\n\tinitialClass: {}\n\tinitialTitle: {}\n\tpid: "
"{}\n\txwayland: {}\n\tpinned: "
- "{}\n\tfullscreen: {}\n\tfullscreenmode: {}\n\tfakefullscreen: {}\n\tgrouped: {}\n\ttags: {}\n\tswallowing: {:x}\n\tfocusHistoryID: {}\n\n",
+ "{}\n\tfullscreen: {}\n\tfullscreenClient: {}\n\tgrouped: {}\n\ttags: {}\n\tswallowing: {:x}\n\tfocusHistoryID: {}\n\n",
(uintptr_t)w.get(), w->m_szTitle, (int)w->m_bIsMapped, (int)w->isHidden(), (int)w->m_vRealPosition.goal().x, (int)w->m_vRealPosition.goal().y,
(int)w->m_vRealSize.goal().x, (int)w->m_vRealSize.goal().y, w->m_pWorkspace ? w->workspaceID() : WORKSPACE_INVALID, (!w->m_pWorkspace ? "" : w->m_pWorkspace->m_szName),
(int)w->m_bIsFloating, (int)w->m_bIsPseudotiled, (int64_t)w->m_iMonitorID, w->m_szClass, w->m_szTitle, w->m_szInitialClass, w->m_szInitialTitle, w->getPID(),
- (int)w->m_bIsX11, (int)w->m_bPinned, (int)w->m_bIsFullscreen, (w->m_bIsFullscreen ? (w->m_pWorkspace ? w->m_pWorkspace->m_efFullscreenMode : 0) : 0),
- (int)w->m_bFakeFullscreenState, getGroupedData(w, format), getTagsData(w, format), (uintptr_t)w->m_pSwallowed.lock().get(), getFocusHistoryID(w));
+ (int)w->m_bIsX11, (int)w->m_bPinned, (uint8_t)w->m_sFullscreenState.internal, (uint8_t)w->m_sFullscreenState.client, getGroupedData(w, format), getTagsData(w, format),
+ (uintptr_t)w->m_pSwallowed.lock().get(), getFocusHistoryID(w));
}
}
diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp
index 4426491d..80138910 100644
--- a/src/desktop/LayerSurface.cpp
+++ b/src/desktop/LayerSurface.cpp
@@ -165,7 +165,7 @@ void CLayerSurface::onMap() {
CBox geomFixed = {geometry.x + PMONITOR->vecPosition.x, geometry.y + PMONITOR->vecPosition.y, geometry.width, geometry.height};
g_pHyprRenderer->damageBox(&geomFixed);
const auto WORKSPACE = PMONITOR->activeWorkspace;
- const bool FULLSCREEN = WORKSPACE->m_bHasFullscreenWindow && WORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL;
+ const bool FULLSCREEN = WORKSPACE->m_bHasFullscreenWindow && WORKSPACE->m_efFullscreenMode == FSMODE_FULLSCREEN;
startAnimation(!(layer == ZWLR_LAYER_SHELL_V1_LAYER_TOP && FULLSCREEN && !GRABSFOCUS));
readyToDelete = false;
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp
index f635d367..9316959d 100644
--- a/src/desktop/Window.cpp
+++ b/src/desktop/Window.cpp
@@ -192,7 +192,7 @@ CBox CWindow::getWindowIdealBoundingBoxIgnoreReserved() {
auto POS = m_vPosition;
auto SIZE = m_vSize;
- if (m_bIsFullscreen) {
+ if (isFullscreen()) {
POS = PMONITOR->vecPosition;
SIZE = PMONITOR->vecSize;
@@ -970,8 +970,9 @@ void CWindow::setGroupCurrent(PHLWINDOW pWindow) {
return;
const auto PCURRENT = getGroupCurrent();
- const bool FULLSCREEN = PCURRENT->m_bIsFullscreen;
+ const bool FULLSCREEN = PCURRENT->isFullscreen();
const auto WORKSPACE = PCURRENT->m_pWorkspace;
+ const auto MODE = PCURRENT->m_sFullscreenState.client;
const auto PWINDOWSIZE = PCURRENT->m_vRealSize.goal();
const auto PWINDOWPOS = PCURRENT->m_vRealPosition.goal();
@@ -979,7 +980,7 @@ void CWindow::setGroupCurrent(PHLWINDOW pWindow) {
const auto CURRENTISFOCUS = PCURRENT == g_pCompositor->m_pLastWindow.lock();
if (FULLSCREEN)
- g_pCompositor->setWindowFullscreen(PCURRENT, false, WORKSPACE->m_efFullscreenMode);
+ g_pCompositor->setWindowFullscreenInternal(PCURRENT, FSMODE_NONE);
PCURRENT->setHidden(true);
pWindow->setHidden(false); // can remove m_pLastWindow
@@ -997,7 +998,7 @@ void CWindow::setGroupCurrent(PHLWINDOW pWindow) {
g_pCompositor->focusWindow(pWindow);
if (FULLSCREEN)
- g_pCompositor->setWindowFullscreen(pWindow, true, WORKSPACE->m_efFullscreenMode);
+ g_pCompositor->setWindowFullscreenInternal(pWindow, MODE);
g_pHyprRenderer->damageWindow(pWindow);
@@ -1140,7 +1141,7 @@ void CWindow::updateWindowData(const SWorkspaceRule& workspaceRule) {
}
int CWindow::getRealBorderSize() {
- if (m_sWindowData.noBorder.valueOrDefault() || (m_pWorkspace && m_bIsFullscreen && (m_pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL)))
+ if (m_sWindowData.noBorder.valueOrDefault() || (m_pWorkspace && isEffectiveInternalFSMode(FSMODE_FULLSCREEN)))
return 0;
static auto PBORDERSIZE = CConfigValue<Hyprlang::INT>("general:border_size");
@@ -1153,11 +1154,6 @@ bool CWindow::canBeTorn() {
return m_sWindowData.tearing.valueOr(m_bTearingHint) && *PTEARING;
}
-bool CWindow::shouldSendFullscreenState() {
- const auto MODE = m_pWorkspace->m_efFullscreenMode;
- return m_bDontSendFullscreen ? false : (m_bFakeFullscreenState || (m_bIsFullscreen && (MODE == FULLSCREEN_FULL)));
-}
-
void CWindow::setSuspended(bool suspend) {
if (suspend == m_bSuspended)
return;
@@ -1184,7 +1180,7 @@ void CWindow::setAnimationsToMove() {
void CWindow::onWorkspaceAnimUpdate() {
// clip box for animated offsets
- if (!m_bIsFloating || m_bPinned || m_bIsFullscreen) {
+ if (!m_bIsFloating || m_bPinned || isFullscreen()) {
m_vFloatingOffset = Vector2D(0, 0);
return;
}
@@ -1238,6 +1234,14 @@ int CWindow::surfacesCount() {
return no;
}
+bool CWindow::isFullscreen() {
+ return m_sFullscreenState.internal != FSMODE_NONE;
+}
+
+bool CWindow::isEffectiveInternalFSMode(const eFullscreenMode MODE) {
+ return (eFullscreenMode)std::bit_floor((uint8_t)m_sFullscreenState.internal) == MODE;
+}
+
int CWindow::workspaceID() {
return m_pWorkspace ? m_pWorkspace->m_iID : m_iLastWorkspace;
}
@@ -1315,19 +1319,17 @@ void CWindow::onUpdateState() {
if (requestsFS.has_value() && !(m_eSuppressedEvents & SUPPRESS_FULLSCREEN)) {
bool fs = requestsFS.value();
-
- if (fs != m_bIsFullscreen && m_bIsMapped)
- g_pCompositor->setWindowFullscreen(m_pSelf.lock(), fs, FULLSCREEN_FULL);
+ if (m_bIsMapped) {
+ g_pCompositor->changeWindowFullscreenModeClient(m_pSelf.lock(), FSMODE_FULLSCREEN, requestsFS.value());
+ }
if (!m_bIsMapped)
m_bWantsInitialFullscreen = fs;
}
if (requestsMX.has_value() && !(m_eSuppressedEvents & SUPPRESS_MAXIMIZE)) {
- bool fs = requestsMX.value();
-
- if (fs != m_bIsFullscreen && m_bIsMapped)
- g_pCompositor->setWindowFullscreen(m_pSelf.lock(), fs, FULLSCREEN_MAXIMIZED);
+ if (m_bIsMapped)
+ g_pCompositor->changeWindowFullscreenModeClient(m_pSelf.lock(), FSMODE_MAXIMIZED, requestsMX.value());
}
}
@@ -1432,7 +1434,7 @@ void CWindow::onX11Configure(CBox box) {
g_pHyprRenderer->damageWindow(m_pSelf.lock());
- if (!m_bIsFloating || m_bIsFullscreen || g_pInputManager->currentlyDraggedWindow == m_pSelf) {
+ if (!m_bIsFloating || isFullscreen() || g_pInputManager->currentlyDraggedWindow == m_pSelf) {
g_pXWaylandManager->setWindowSize(m_pSelf.lock(), m_vRealSize.goal(), true);
g_pInputManager->refocus();
g_pHyprRenderer->damageWindow(m_pSelf.lock());
diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp
index 108b804c..11bf662a 100644
--- a/src/desktop/Window.hpp
+++ b/src/desktop/Window.hpp
@@ -16,6 +16,7 @@
#include "Popup.hpp"
#include "Subsurface.hpp"
#include "WLSurface.hpp"
+#include "Workspace.hpp"
class CXDGSurfaceResource;
class CXWaylandSurface;
@@ -170,6 +171,7 @@ struct SWindowData {
CWindowOverridableVar<bool> noShortcutsInhibit = false;
CWindowOverridableVar<bool> opaque = false;
CWindowOverridableVar<bool> RGBX = false;
+ CWindowOverridableVar<bool> syncFullscreen = true;
CWindowOverridableVar<bool> tearing = false;
CWindowOverridableVar<bool> xray = false;
@@ -208,6 +210,11 @@ struct SInitialWorkspaceToken {
std::string workspace;
};
+struct sFullscreenState {
+ eFullscreenMode internal = FSMODE_NONE;
+ eFullscreenMode client = FSMODE_NONE;
+};
+
class CWindow {
public:
static PHLWINDOW create(SP<CXDGSurfaceResource>);
@@ -256,24 +263,23 @@ class CWindow {
Vector2D m_vPseudoSize = Vector2D(1280, 720);
// for recovering relative cursor position
- Vector2D m_vRelativeCursorCoordsOnLastWarp = Vector2D(-1, -1);
+ Vector2D m_vRelativeCursorCoordsOnLastWarp = Vector2D(-1, -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_szClass = "";
- std::string m_szInitialTitle = "";
- std::string m_szInitialClass = "";
- PHLWORKSPACE m_pWorkspace;
+ bool m_bFirstMap = false; // for layouts
+ bool m_bIsFloating = false;
+ bool m_bDraggingTiled = false; // for dragging around tiled windows
+ bool m_bWasMaximized = false;
+ sFullscreenState m_sFullscreenState = {.internal = FSMODE_NONE, .client = FSMODE_NONE};
+ uint64_t m_iMonitorID = -1;
+ std::string m_szTitle = "";
+ std::string m_szClass = "";
+ std::string m_szInitialTitle = "";
+ std::string m_szInitialClass = "";
+ PHLWORKSPACE m_pWorkspace;
- bool m_bIsMapped = false;
+ bool m_bIsMapped = false;
- bool m_bRequestsFloat = false;
+ bool m_bRequestsFloat = false;
// This is for fullscreen apps
bool m_bCreatedOverFullscreen = false;
@@ -322,9 +328,6 @@ class CWindow {
// urgency hint
bool m_bIsUrgent = false;
- // fakefullscreen
- bool m_bFakeFullscreenState = false;
-
// for proper cycling. While cycling we can't just move the pointers, so we need to keep track of the last cycled window.
PHLWINDOWREF m_pLastCycledWindow;
@@ -416,7 +419,6 @@ class CWindow {
bool opaque();
float rounding();
bool canBeTorn();
- bool shouldSendFullscreenState();
void setSuspended(bool suspend);
bool visibleOnMonitor(CMonitor* pMonitor);
int workspaceID();
@@ -424,6 +426,9 @@ class CWindow {
void activate(bool force = false);
int surfacesCount();
+ bool isFullscreen();
+ bool isEffectiveInternalFSMode(const eFullscreenMode);
+
int getRealBorderSize();
void updateWindowData();
void updateWindowData(const struct SWorkspaceRule&);
diff --git a/src/desktop/Workspace.cpp b/src/desktop/Workspace.cpp
index 34db914e..a08f1804 100644
--- a/src/desktop/Workspace.cpp
+++ b/src/desktop/Workspace.cpp
@@ -480,16 +480,11 @@ bool CWorkspace::matchesStaticSelector(const std::string& selector_) {
return false;
break;
case 0: // fullscreen full
- if (!m_bHasFullscreenWindow || m_efFullscreenMode != FULLSCREEN_FULL)
+ if (!m_bHasFullscreenWindow || m_efFullscreenMode != FSMODE_FULLSCREEN)
return false;
break;
case 1: // maximized
- if (!m_bHasFullscreenWindow || m_efFullscreenMode != FULLSCREEN_MAXIMIZED)
- return false;
- break;
- case 2: // fullscreen without sending fullscreen state to window
- if (!m_bHasFullscreenWindow || m_efFullscreenMode != FULLSCREEN_FULL || !g_pCompositor->getFullscreenWindowOnWorkspace(m_iID) ||
- !g_pCompositor->getFullscreenWindowOnWorkspace(m_iID)->m_bDontSendFullscreen)
+ if (!m_bHasFullscreenWindow || m_efFullscreenMode != FSMODE_MAXIMIZED)
return false;
break;
default: break;
diff --git a/src/desktop/Workspace.hpp b/src/desktop/Workspace.hpp
index bb5cd441..3e9ac8a8 100644
--- a/src/desktop/Workspace.hpp
+++ b/src/desktop/Workspace.hpp
@@ -7,9 +7,10 @@
#include "../helpers/MiscFunctions.hpp"
enum eFullscreenMode : int8_t {
- FULLSCREEN_INVALID = -1,
- FULLSCREEN_FULL = 0,
- FULLSCREEN_MAXIMIZED
+ FSMODE_NONE = 0,
+ FSMODE_MAXIMIZED = 1 << 0,
+ FSMODE_FULLSCREEN = 1 << 1,
+ FSMODE_MAX = (1 << 2) - 1
};
class CWindow;
@@ -31,7 +32,7 @@ class CWorkspace {
SWorkspaceIDName m_sPrevWorkspace, m_sPrevWorkspacePerMonitor;
bool m_bHasFullscreenWindow = false;
- eFullscreenMode m_efFullscreenMode = FULLSCREEN_FULL;
+ eFullscreenMode m_efFullscreenMode = FSMODE_NONE;
wl_array m_wlrCoordinateArr;
diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp
index b2abb65c..71ad4ba1 100644
--- a/src/events/Windows.cpp
+++ b/src/events/Windows.cpp
@@ -133,12 +133,11 @@ void Events::listener_mapWindow(void* owner, void* data) {
}
// window rules
- PWINDOW->m_vMatchedRules = g_pConfigManager->getMatchingRules(PWINDOW, false);
- bool requestsFullscreen = PWINDOW->m_bWantsInitialFullscreen || (PWINDOW->m_bIsX11 && PWINDOW->m_pXWaylandSurface->fullscreen);
- bool requestsFakeFullscreen = false;
- bool requestsMaximize = false;
- bool overridingNoFullscreen = false;
- bool overridingNoMaximize = false;
+ PWINDOW->m_vMatchedRules = g_pConfigManager->getMatchingRules(PWINDOW, false);
+ std::optional<eFullscreenMode> requestedInternalFSMode, requestedClientFSMode;
+ std::optional<sFullscreenState> requestedFSState;
+ if (PWINDOW->m_bWantsInitialFullscreen || (PWINDOW->m_bIsX11 && PWINDOW->m_pXWaylandSurface->fullscreen))
+ requestedClientFSMode = FSMODE_FULLSCREEN;
for (auto& r : PWINDOW->m_vMatchedRules) {
if (r.szRule.starts_with("monitor")) {
@@ -199,6 +198,16 @@ void Events::listener_mapWindow(void* owner, void* data) {
PWINDOW->m_bIsPseudotiled = true;
} else if (r.szRule.starts_with("noinitialfocus")) {
PWINDOW->m_bNoInitialFocus = true;
+ } else if (r.szRule.starts_with("fullscreenstate")) {
+ const auto ARGS = CVarList(r.szRule.substr(r.szRule.find_first_of(' ') + 1), 2, ' ');
+ int internalMode, clientMode;
+ try {
+ internalMode = std::stoi(ARGS[0]);
+ } catch (std::exception& e) { internalMode = 0; }
+ try {
+ clientMode = std::stoi(ARGS[1]);
+ } catch (std::exception& e) { clientMode = 0; }
+ requestedFSState = sFullscreenState{.internal = (eFullscreenMode)internalMode, .client = (eFullscreenMode)clientMode};
} else if (r.szRule.starts_with("suppressevent")) {
CVarList vars(r.szRule, 0, 's', true);
for (size_t i = 1; i < vars.size(); ++i) {
@@ -213,16 +222,12 @@ void Events::listener_mapWindow(void* owner, void* data) {
else
Debug::log(ERR, "Error while parsing suppressevent windowrule: unknown event type {}", vars[i]);
}
- } else if (r.szRule == "fullscreen") {
- requestsFullscreen = true;
- overridingNoFullscreen = true;
- } else if (r.szRule == "fakefullscreen") {
- requestsFakeFullscreen = true;
} else if (r.szRule == "pin") {
PWINDOW->m_bPinned = true;
+ } else if (r.szRule == "fullscreen") {
+ requestedInternalFSMode = FSMODE_FULLSCREEN;
} else if (r.szRule == "maximize") {
- requestsMaximize = true;
- overridingNoMaximize = true;
+ requestedInternalFSMode = FSMODE_MAXIMIZED;
} else if (r.szRule == "stayfocused") {
PWINDOW->m_bStayFocused = true;
} else if (r.szRule.starts_with("group")) {
@@ -461,17 +466,14 @@ void Events::listener_mapWindow(void* owner, void* data) {
const auto PLSFROMFOCUS = g_pCompositor->getLayerSurfaceFromSurface(g_pCompositor->m_pLastFocus.lock());
if (PLSFROMFOCUS && PLSFROMFOCUS->layerSurface->current.interactivity != ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE)
PWINDOW->m_bNoInitialFocus = true;
- if (PWINDOW->m_pWorkspace->m_bHasFullscreenWindow && !requestsFullscreen && !PWINDOW->m_bIsFloating) {
+
+ if (PWINDOW->m_pWorkspace->m_bHasFullscreenWindow && !requestedInternalFSMode.has_value() && !requestedClientFSMode.has_value() && !PWINDOW->m_bIsFloating) {
if (*PNEWTAKESOVERFS == 0)
PWINDOW->m_bNoInitialFocus = true;
+ else if (*PNEWTAKESOVERFS == 1)
+ requestedInternalFSMode = PWINDOW->m_pWorkspace->m_efFullscreenMode;
else if (*PNEWTAKESOVERFS == 2)
- g_pCompositor->setWindowFullscreen(g_pCompositor->getFullscreenWindowOnWorkspace(PWINDOW->m_pWorkspace->m_iID), false, FULLSCREEN_INVALID);
- else if (PWINDOW->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) {
- requestsMaximize = true;
- if (*PNEWTAKESOVERFS == 1)
- overridingNoMaximize = true;
- } else
- requestsFullscreen = true;
+ g_pCompositor->setWindowFullscreenInternal(g_pCompositor->getFullscreenWindowOnWorkspace(PWINDOW->m_pWorkspace->m_iID), FSMODE_NONE);
}
if (!PWINDOW->m_sWindowData.noFocus.valueOrDefault() && !PWINDOW->m_bNoInitialFocus &&
@@ -485,24 +487,27 @@ void Events::listener_mapWindow(void* owner, void* data) {
PWINDOW->m_fDimPercent.setValueAndWarp(0);
}
- if ((requestsFullscreen && (!(PWINDOW->m_eSuppressedEvents & SUPPRESS_FULLSCREEN) || overridingNoFullscreen)) ||
- (requestsMaximize && (!(PWINDOW->m_eSuppressedEvents & SUPPRESS_MAXIMIZE) || overridingNoMaximize)) || requestsFakeFullscreen) {
- // fix fullscreen on requested (basically do a switcheroo)
- if (PWINDOW->m_pWorkspace->m_bHasFullscreenWindow) {
- const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWINDOW->m_pWorkspace->m_iID);
- g_pCompositor->setWindowFullscreen(PFULLWINDOW, false, FULLSCREEN_FULL);
- }
+ if (requestedClientFSMode.has_value() && !(PWINDOW->m_eSuppressedEvents & SUPPRESS_FULLSCREEN))
+ requestedClientFSMode = (eFullscreenMode)((uint8_t)requestedClientFSMode.value_or(FSMODE_NONE) & ~(uint8_t)FSMODE_FULLSCREEN);
+ if (requestedClientFSMode.has_value() && !(PWINDOW->m_eSuppressedEvents & SUPPRESS_MAXIMIZE))
+ requestedClientFSMode = (eFullscreenMode)((uint8_t)requestedClientFSMode.value_or(FSMODE_NONE) & ~(uint8_t)FSMODE_MAXIMIZED);
- if (requestsFakeFullscreen && !PWINDOW->m_bFakeFullscreenState) {
- 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);
- }
+ if (!PWINDOW->m_bNoInitialFocus && (requestedInternalFSMode.has_value() || requestedClientFSMode.has_value() || requestedFSState.has_value())) {
+ // fix fullscreen on requested (basically do a switcheroo)
+ if (PWINDOW->m_pWorkspace->m_bHasFullscreenWindow)
+ g_pCompositor->setWindowFullscreenInternal(g_pCompositor->getFullscreenWindowOnWorkspace(PWINDOW->m_pWorkspace->m_iID), FSMODE_NONE);
+
+ PWINDOW->m_vRealPosition.warp();
+ PWINDOW->m_vRealSize.warp();
+ if (requestedFSState.has_value()) {
+ PWINDOW->m_sWindowData.syncFullscreen = CWindowOverridableVar(false, PRIORITY_WINDOW_RULE);
+ g_pCompositor->setWindowFullscreenState(PWINDOW, requestedFSState.value());
+ } else if (requestedInternalFSMode.has_value() && requestedClientFSMode.has_value() && !PWINDOW->m_sWindowData.syncFullscreen.valueOrDefault())
+ g_pCompositor->setWindowFullscreenState(PWINDOW, sFullscreenState{.internal = requestedInternalFSMode.value(), .client = requestedClientFSMode.value()});
+ else if (requestedInternalFSMode.has_value())
+ g_pCompositor->setWindowFullscreenInternal(PWINDOW, requestedInternalFSMode.value());
+ else if (requestedClientFSMode.has_value())
+ g_pCompositor->setWindowFullscreenClient(PWINDOW, requestedClientFSMode.value());
}
// recheck idle inhibitors
@@ -558,7 +563,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
// recalc the values for this window
g_pCompositor->updateWindowAnimatedDecorationValues(PWINDOW);
// avoid this window being visible
- if (PWORKSPACE->m_bHasFullscreenWindow && !PWINDOW->m_bIsFullscreen && !PWINDOW->m_bIsFloating)
+ if (PWORKSPACE->m_bHasFullscreenWindow && !PWINDOW->isFullscreen() && !PWINDOW->m_bIsFloating)
PWINDOW->m_fAlpha.setValueAndWarp(0.f);
g_pCompositor->setPreferredScaleForSurface(PWINDOW->m_pWLSurface->resource(), PMONITOR->scale);
@@ -583,8 +588,8 @@ void Events::listener_unmapWindow(void* owner, void* data) {
static auto PEXITRETAINSFS = CConfigValue<Hyprlang::INT>("misc:exit_window_retains_fullscreen");
- const auto CURRENTWINDOWFSSTATE = PWINDOW->m_bIsFullscreen;
- const auto CURRENTWINDOWFSMODE = PWINDOW->m_pWorkspace->m_efFullscreenMode;
+ const auto CURRENTWINDOWFSSTATE = PWINDOW->isFullscreen();
+ const auto CURRENTFSMODE = PWINDOW->m_sFullscreenState.internal;
if (!PWINDOW->m_pWLSurface->exists() || !PWINDOW->m_bIsMapped) {
Debug::log(WARN, "{} unmapped without being mapped??", PWINDOW);
@@ -604,8 +609,8 @@ void Events::listener_unmapWindow(void* owner, void* data) {
PROTO::toplevelExport->onWindowUnmap(PWINDOW);
- if (PWINDOW->m_bIsFullscreen)
- g_pCompositor->setWindowFullscreen(PWINDOW, false, FULLSCREEN_FULL);
+ if (PWINDOW->isFullscreen())
+ g_pCompositor->setWindowFullscreenInternal(PWINDOW, FSMODE_NONE);
// Allow the renderer to catch the last frame.
g_pHyprOpenGL->makeWindowSnapshot(PWINDOW);
@@ -633,7 +638,7 @@ void Events::listener_unmapWindow(void* owner, void* data) {
// remove the fullscreen window status from workspace if we closed it
const auto PWORKSPACE = PWINDOW->m_pWorkspace;
- if (PWORKSPACE->m_bHasFullscreenWindow && PWINDOW->m_bIsFullscreen)
+ if (PWORKSPACE->m_bHasFullscreenWindow && PWINDOW->isFullscreen())
PWORKSPACE->m_bHasFullscreenWindow = false;
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW);
@@ -650,7 +655,7 @@ void Events::listener_unmapWindow(void* owner, void* data) {
if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow.lock() && PWINDOWCANDIDATE) {
g_pCompositor->focusWindow(PWINDOWCANDIDATE);
if (*PEXITRETAINSFS && CURRENTWINDOWFSSTATE)
- g_pCompositor->setWindowFullscreen(PWINDOWCANDIDATE, true, CURRENTWINDOWFSMODE);
+ g_pCompositor->setWindowFullscreenInternal(PWINDOWCANDIDATE, CURRENTFSMODE);
}
if (!PWINDOWCANDIDATE && g_pCompositor->getWindowsOnWorkspace(PWINDOW->workspaceID()) == 0)
@@ -708,7 +713,7 @@ void Events::listener_commitWindow(void* owner, void* data) {
PWINDOW->m_vReportedSize = PWINDOW->m_vPendingReportedSize; // apply pending size. We pinged, the window ponged.
- if (!PWINDOW->m_bIsX11 && !PWINDOW->m_bIsFullscreen && PWINDOW->m_bIsFloating) {
+ if (!PWINDOW->m_bIsX11 && !PWINDOW->isFullscreen() && PWINDOW->m_bIsFloating) {
const auto MINSIZE = PWINDOW->m_pXDGSurface->toplevel->current.minSize;
const auto MAXSIZE = PWINDOW->m_pXDGSurface->toplevel->current.maxSize;
@@ -835,7 +840,7 @@ void Events::listener_unmanagedSetGeometry(void* owner, void* data) {
else
PWINDOW->setHidden(true);
- if (PWINDOW->m_bIsFullscreen || !PWINDOW->m_bIsFloating) {
+ if (PWINDOW->isFullscreen() || !PWINDOW->m_bIsFloating) {
g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goal(), true);
g_pHyprRenderer->damageWindow(PWINDOW);
return;
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 33fe0c04..377825fb 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -354,7 +354,7 @@ bool CMonitor::shouldSkipScheduleFrameOnMouseEvent() {
// skip scheduling extra frames for fullsreen apps with vrr
bool shouldSkip =
- *PNOBREAK && output->state->state().adaptiveSync && activeWorkspace && activeWorkspace->m_bHasFullscreenWindow && activeWorkspace->m_efFullscreenMode == FULLSCREEN_FULL;
+ *PNOBREAK && output->state->state().adaptiveSync && activeWorkspace && activeWorkspace->m_bHasFullscreenWindow && activeWorkspace->m_efFullscreenMode == FSMODE_FULLSCREEN;
// keep requested minimum refresh rate
if (shouldSkip && *PMINRR && lastPresentationTimer.getMillis() > 1000 / *PMINRR) {
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index 7fa6fdbc..336c8c68 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -136,11 +136,12 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
return;
}
- if (PWINDOW->m_bIsFullscreen && !pNode->ignoreFullscreenChecks)
+ if (PWINDOW->isFullscreen() && !pNode->ignoreFullscreenChecks)
return;
PWINDOW->unsetWindowData(PRIORITY_LAYOUT);
PWINDOW->updateWindowData();
+ PWINDOW->updateWindowDecos();
static auto PNOGAPSWHENONLY = CConfigValue<Hyprlang::INT>("dwindle:no_gaps_when_only");
static auto PGAPSINDATA = CConfigValue<Hyprlang::CUSTOMTYPE>("general:gaps_in");
@@ -158,8 +159,7 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
const auto NODESONWORKSPACE = getNodesOnWorkspace(PWINDOW->workspaceID());
- if (*PNOGAPSWHENONLY && !PWINDOW->onSpecialWorkspace() &&
- (NODESONWORKSPACE == 1 || (PWINDOW->m_bIsFullscreen && PWINDOW->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_MAXIMIZED))) {
+ if (*PNOGAPSWHENONLY && !PWINDOW->onSpecialWorkspace() && (NODESONWORKSPACE == 1 || PWINDOW->isEffectiveInternalFSMode(FSMODE_MAXIMIZED))) {
PWINDOW->m_sWindowData.decorate = CWindowOverridableVar(true, PRIORITY_LAYOUT);
PWINDOW->m_sWindowData.noBorder = CWindowOverridableVar(*PNOGAPSWHENONLY != 2, PRIORITY_LAYOUT);
@@ -216,7 +216,7 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
calcPos = calcPos + RESERVED.topLeft;
calcSize = calcSize - (RESERVED.topLeft + RESERVED.bottomRight);
- if (PWINDOW->onSpecialWorkspace() && !PWINDOW->m_bIsFullscreen) {
+ if (PWINDOW->onSpecialWorkspace() && !PWINDOW->isFullscreen()) {
// if special, we adjust the coords a bit
static auto PSCALEFACTOR = CConfigValue<Hyprlang::FLOAT>("dwindle:special_scale_factor");
@@ -500,8 +500,8 @@ void CHyprDwindleLayout::onWindowRemovedTiling(PHLWINDOW pWindow) {
pWindow->unsetWindowData(PRIORITY_LAYOUT);
pWindow->updateWindowData();
- if (pWindow->m_bIsFullscreen)
- g_pCompositor->setWindowFullscreen(pWindow, false, FULLSCREEN_FULL);
+ if (pWindow->isFullscreen())
+ g_pCompositor->setWindowFullscreenInternal(pWindow, FSMODE_NONE);
const auto PPARENT = PNODE->pParent;
@@ -560,10 +560,10 @@ void CHyprDwindleLayout::calculateWorkspace(const PHLWORKSPACE& pWorkspace) {
// massive hack from the fullscreen func
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(pWorkspace->m_iID);
- if (pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL) {
+ if (pWorkspace->m_efFullscreenMode == FSMODE_FULLSCREEN) {
PFULLWINDOW->m_vRealPosition = PMONITOR->vecPosition;
PFULLWINDOW->m_vRealSize = PMONITOR->vecSize;
- } else if (pWorkspace->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) {
+ } else if (pWorkspace->m_efFullscreenMode == FSMODE_MAXIMIZED) {
SDwindleNodeData fakeNode;
fakeNode.pWindow = PFULLWINDOW;
fakeNode.box = {PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft, PMONITOR->vecSize - PMONITOR->vecReservedTopLeft - PMONITOR->vecReservedBottomRight};
@@ -788,41 +788,19 @@ void CHyprDwindleLayout::resizeActiveWindow(const Vector2D& pixResize, eRectCorn
}
}
-void CHyprDwindleLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, eFullscreenMode fullscreenMode, bool on) {
- if (!validMapped(pWindow))
- return;
-
- if (on == pWindow->m_bIsFullscreen)
- return; // ignore
-
+void CHyprDwindleLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, const eFullscreenMode CURRENT_EFFECTIVE_MODE, const eFullscreenMode EFFECTIVE_MODE) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
const auto PWORKSPACE = pWindow->m_pWorkspace;
- if (PWORKSPACE->m_bHasFullscreenWindow && on) {
- // if the window wants to be fullscreen but there already is one,
- // ignore the request.
- return;
- }
-
// save position and size if floating
- if (pWindow->m_bIsFloating && on) {
+ if (pWindow->m_bIsFloating && CURRENT_EFFECTIVE_MODE == FSMODE_NONE) {
pWindow->m_vLastFloatingSize = pWindow->m_vRealSize.goal();
pWindow->m_vLastFloatingPosition = pWindow->m_vRealPosition.goal();
pWindow->m_vPosition = pWindow->m_vRealPosition.goal();
pWindow->m_vSize = pWindow->m_vRealSize.goal();
}
- // otherwise, accept it.
- pWindow->m_bIsFullscreen = on;
- PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow;
-
- pWindow->updateDynamicRules();
- pWindow->updateWindowDecos();
-
- g_pEventManager->postEvent(SHyprIPCEvent{"fullscreen", std::to_string((int)on)});
- EMIT_HOOK_EVENT("fullscreen", pWindow);
-
- if (!pWindow->m_bIsFullscreen) {
+ if (EFFECTIVE_MODE == FSMODE_NONE) {
// if it got its fullscreen disabled, set back its node if it had one
const auto PNODE = getNodeFromWindow(pWindow);
if (PNODE)
@@ -836,12 +814,8 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, eFullscre
pWindow->updateWindowData();
}
} else {
- // if it now got fullscreen, make it fullscreen
-
- PWORKSPACE->m_efFullscreenMode = fullscreenMode;
-
// apply new pos and size being monitors' box
- if (fullscreenMode == FULLSCREEN_FULL) {
+ if (EFFECTIVE_MODE == FSMODE_FULLSCREEN) {
pWindow->m_vRealPosition = PMONITOR->vecPosition;
pWindow->m_vRealSize = PMONITOR->vecSize;
} else {
@@ -861,13 +835,7 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, eFullscre
}
}
- g_pCompositor->updateWindowAnimatedDecorationValues(pWindow);
-
- g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goal());
-
g_pCompositor->changeWindowZOrder(pWindow, true);
-
- recalculateMonitor(PMONITOR->ID);
}
void CHyprDwindleLayout::recalculateWindow(PHLWINDOW pWindow) {
@@ -957,13 +925,11 @@ void CHyprDwindleLayout::switchWindows(PHLWINDOW pWindow, PHLWINDOW pWindow2) {
if (!PNODE2 || !PNODE)
return;
- const bool FS1 = pWindow->m_bIsFullscreen;
- const bool FS2 = pWindow2->m_bIsFullscreen;
+ const eFullscreenMode MODE1 = pWindow->m_sFullscreenState.internal;
+ const eFullscreenMode MODE2 = pWindow->m_sFullscreenState.internal;
- if (FS1)
- g_pCompositor->setWindowFullscreen(pWindow, false);
- if (FS2)
- g_pCompositor->setWindowFullscreen(pWindow2, false);
+ g_pCompositor->setWindowFullscreenInternal(pWindow, FSMODE_NONE);
+ g_pCompositor->setWindowFullscreenInternal(pWindow2, FSMODE_NONE);
SDwindleNodeData* ACTIVE1 = nullptr;
SDwindleNodeData* ACTIVE2 = nullptr;
@@ -1001,10 +967,8 @@ void CHyprDwindleLayout::switchWindows(PHLWINDOW pWindow, PHLWINDOW pWindow2) {
g_pHyprRenderer->damageWindow(pWindow);
g_pHyprRenderer->damageWindow(pWindow2);
- if (FS1)
- g_pCompositor->setWindowFullscreen(pWindow2, true);
- if (FS2)
- g_pCompositor->setWindowFullscreen(pWindow, true);
+ g_pCompositor->setWindowFullscreenInternal(pWindow2, MODE1);
+ g_pCompositor->setWindowFullscreenInternal(pWindow, MODE2);
}
void CHyprDwindleLayout::alterSplitRatio(PHLWINDOW pWindow, float ratio, bool exact) {
@@ -1072,7 +1036,7 @@ void CHyprDwindleLayout::toggleSplit(PHLWINDOW pWindow) {
if (!PNODE || !PNODE->pParent)
return;
- if (pWindow->m_bIsFullscreen)
+ if (pWindow->isFullscreen())
return;
PNODE->pParent->splitTop = !PNODE->pParent->splitTop;
@@ -1086,7 +1050,7 @@ void CHyprDwindleLayout::swapSplit(PHLWINDOW pWindow) {
if (!PNODE || !PNODE->pParent)
return;
- if (pWindow->m_bIsFullscreen)
+ if (pWindow->isFullscreen())
return;
std::swap(PNODE->pParent->children[0], PNODE->pParent->children[1]);
diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp
index 13834bc7..f638f6a2 100644
--- a/src/layout/DwindleLayout.hpp
+++ b/src/layout/DwindleLayout.hpp
@@ -52,7 +52,7 @@ class CHyprDwindleLayout : public IHyprLayout {
virtual void recalculateWindow(PHLWINDOW);
virtual void onBeginDragWindow();
virtual void resizeActiveWindow(const Vector2D&, eRectCorner corner = CORNER_NONE, PHLWINDOW pWindow = nullptr);
- virtual void fullscreenRequestForWindow(PHLWINDOW, eFullscreenMode, bool);
+ virtual void fullscreenRequestForWindow(PHLWINDOW pWindow, const eFullscreenMode CURRENT_EFFECTIVE_MODE, const eFullscreenMode EFFECTIVE_MODE);
virtual std::any layoutMessage(SLayoutMessageHeader, std::string);
virtual SWindowRenderLayoutHints requestRenderHints(PHLWINDOW);
virtual void switchWindows(PHLWINDOW, PHLWINDOW);
diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp
index 0738b71c..233933d4 100644
--- a/src/layout/IHyprLayout.cpp
+++ b/src/layout/IHyprLayout.cpp
@@ -29,8 +29,8 @@ void IHyprLayout::onWindowCreated(PHLWINDOW pWindow, eDirection direction) {
}
void IHyprLayout::onWindowRemoved(PHLWINDOW pWindow) {
- if (pWindow->m_bIsFullscreen)
- g_pCompositor->setWindowFullscreen(pWindow, false, FULLSCREEN_FULL);
+ if (pWindow->isFullscreen())
+ g_pCompositor->setWindowFullscreenInternal(pWindow, FSMODE_NONE);
if (!pWindow->m_sGroupData.pNextWindow.expired()) {
if (pWindow->m_sGroupData.pNextWindow.lock() == pWindow)
@@ -191,9 +191,9 @@ void IHyprLayout::onBeginDragWindow() {
return;
}
- if (DRAGGINGWINDOW->m_bIsFullscreen) {
+ if (DRAGGINGWINDOW->isFullscreen()) {
Debug::log(LOG, "Dragging a fullscreen window");
- g_pCompositor->setWindowFullscreen(DRAGGINGWINDOW, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenInternal(DRAGGINGWINDOW, FSMODE_NONE);
}
const auto PWORKSPACE = DRAGGINGWINDOW->m_pWorkspace;
@@ -475,9 +475,9 @@ void IHyprLayout::onMouseMove(const Vector2D& mousePos) {
void IHyprLayout::changeWindowFloatingMode(PHLWINDOW pWindow) {
- if (pWindow->m_bIsFullscreen) {
+ if (pWindow->isFullscreen()) {
Debug::log(LOG, "changeWindowFloatingMode: fullscreen");
- g_pCompositor->setWindowFullscreen(pWindow, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenInternal(pWindow, FSMODE_NONE);
}
pWindow->m_bPinned = false;
@@ -497,7 +497,7 @@ void IHyprLayout::changeWindowFloatingMode(PHLWINDOW pWindow) {
const auto PWORKSPACE = PNEWMON->activeSpecialWorkspace ? PNEWMON->activeSpecialWorkspace : PNEWMON->activeWorkspace;
if (PWORKSPACE->m_bHasFullscreenWindow)
- g_pCompositor->setWindowFullscreen(g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID), false);
+ g_pCompositor->setWindowFullscreenInternal(g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID), FSMODE_NONE);
// save real pos cuz the func applies the default 5,5 mid
const auto PSAVEDPOS = pWindow->m_vRealPosition.goal();
diff --git a/src/layout/IHyprLayout.hpp b/src/layout/IHyprLayout.hpp
index 74a00d19..4b1b59e3 100644
--- a/src/layout/IHyprLayout.hpp
+++ b/src/layout/IHyprLayout.hpp
@@ -110,7 +110,7 @@ class IHyprLayout {
The layout sets all the fullscreen flags.
It can either accept or ignore.
*/
- virtual void fullscreenRequestForWindow(PHLWINDOW, eFullscreenMode, bool) = 0;
+ virtual void fullscreenRequestForWindow(PHLWINDOW pWindow, const eFullscreenMode CURRENT_EFFECTIVE_MODE, const eFullscreenMode EFFECTIVE_MODE) = 0;
/*
Called when a dispatcher requests a custom message
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index d7f264e7..e3aaa767 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -267,7 +267,8 @@ void CHyprMasterLayout::onWindowRemovedTiling(PHLWINDOW pWindow) {
pWindow->unsetWindowData(PRIORITY_LAYOUT);
pWindow->updateWindowData();
- g_pCompositor->setWindowFullscreen(pWindow, false, FULLSCREEN_FULL);
+ if (pWindow->isFullscreen())
+ g_pCompositor->setWindowFullscreenInternal(pWindow, FSMODE_NONE);
if (PNODE->isMaster && (MASTERSLEFT <= 1 || *SMALLSPLIT == 1)) {
// find a new master from top of the list
@@ -327,10 +328,10 @@ void CHyprMasterLayout::calculateWorkspace(PHLWORKSPACE pWorkspace) {
// massive hack from the fullscreen func
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(pWorkspace->m_iID);
- if (pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL) {
+ if (pWorkspace->m_efFullscreenMode == FSMODE_FULLSCREEN) {
PFULLWINDOW->m_vRealPosition = PMONITOR->vecPosition;
PFULLWINDOW->m_vRealSize = PMONITOR->vecSize;
- } else if (pWorkspace->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) {
+ } else if (pWorkspace->m_efFullscreenMode == FSMODE_MAXIMIZED) {
SMasterNodeData fakeNode;
fakeNode.pWindow = PFULLWINDOW;
fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft;
@@ -644,11 +645,12 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
// if user specified them in config
const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(PWINDOW->m_pWorkspace);
- if (PWINDOW->m_bIsFullscreen && !pNode->ignoreFullscreenChecks)
+ if (PWINDOW->isFullscreen() && !pNode->ignoreFullscreenChecks)
return;
PWINDOW->unsetWindowData(PRIORITY_LAYOUT);
PWINDOW->updateWindowData();
+ PWINDOW->updateWindowDecos();
static auto PNOGAPSWHENONLY = CConfigValue<Hyprlang::INT>("master:no_gaps_when_only");
static auto PANIMATE = CConfigValue<Hyprlang::INT>("misc:animate_manual_resizes");
@@ -668,8 +670,7 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
PWINDOW->m_vSize = pNode->size;
PWINDOW->m_vPosition = pNode->position;
- if (*PNOGAPSWHENONLY && !PWINDOW->onSpecialWorkspace() &&
- (getNodesOnWorkspace(PWINDOW->workspaceID()) == 1 || (PWINDOW->m_bIsFullscreen && PWINDOW->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_MAXIMIZED))) {
+ if (*PNOGAPSWHENONLY && !PWINDOW->onSpecialWorkspace() && (getNodesOnWorkspace(PWINDOW->workspaceID()) == 1 || PWINDOW->isEffectiveInternalFSMode(FSMODE_MAXIMIZED))) {
PWINDOW->m_sWindowData.decorate = CWindowOverridableVar(true, PRIORITY_LAYOUT);
PWINDOW->m_sWindowData.noBorder = CWindowOverridableVar(*PNOGAPSWHENONLY != 2, PRIORITY_LAYOUT);
@@ -702,7 +703,7 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
calcPos = calcPos + RESERVED.topLeft;
calcSize = calcSize - (RESERVED.topLeft + RESERVED.bottomRight);
- if (PWINDOW->onSpecialWorkspace() && !PWINDOW->m_bIsFullscreen) {
+ if (PWINDOW->onSpecialWorkspace() && !PWINDOW->isFullscreen()) {
static auto PSCALEFACTOR = CConfigValue<Hyprlang::FLOAT>("master:special_scale_factor");
CBox wb = {calcPos + (calcSize - calcSize * *PSCALEFACTOR) / 2.f, calcSize * *PSCALEFACTOR};
@@ -880,41 +881,19 @@ void CHyprMasterLayout::resizeActiveWindow(const Vector2D& pixResize, eRectCorne
m_bForceWarps = false;
}
-void CHyprMasterLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, eFullscreenMode fullscreenMode, bool on) {
- if (!validMapped(pWindow))
- return;
-
- if (on == pWindow->m_bIsFullscreen)
- return; // ignore
-
+void CHyprMasterLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, const eFullscreenMode CURRENT_EFFECTIVE_MODE, const eFullscreenMode EFFECTIVE_MODE) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID);
const auto PWORKSPACE = pWindow->m_pWorkspace;
- if (PWORKSPACE->m_bHasFullscreenWindow && on) {
- // if the window wants to be fullscreen but there already is one,
- // ignore the request.
- return;
- }
-
// save position and size if floating
- if (pWindow->m_bIsFloating && on) {
+ if (pWindow->m_bIsFloating && CURRENT_EFFECTIVE_MODE == FSMODE_NONE) {
pWindow->m_vLastFloatingSize = pWindow->m_vRealSize.goal();
pWindow->m_vLastFloatingPosition = pWindow->m_vRealPosition.goal();
pWindow->m_vPosition = pWindow->m_vRealPosition.goal();
pWindow->m_vSize = pWindow->m_vRealSize.goal();
}
- // otherwise, accept it.
- pWindow->m_bIsFullscreen = on;
- PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow;
-
- pWindow->updateDynamicRules();
- pWindow->updateWindowDecos();
-
- g_pEventManager->postEvent(SHyprIPCEvent{"fullscreen", std::to_string((int)on)});
- EMIT_HOOK_EVENT("fullscreen", pWindow);
-
- if (!pWindow->m_bIsFullscreen) {
+ if (EFFECTIVE_MODE == FSMODE_NONE) {
// if it got its fullscreen disabled, set back its node if it had one
const auto PNODE = getNodeFromWindow(pWindow);
if (PNODE)
@@ -928,12 +907,8 @@ void CHyprMasterLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, eFullscree
pWindow->updateWindowData();
}
} else {
- // if it now got fullscreen, make it fullscreen
-
- PWORKSPACE->m_efFullscreenMode = fullscreenMode;
-
// apply new pos and size being monitors' box
- if (fullscreenMode == FULLSCREEN_FULL) {
+ if (EFFECTIVE_MODE == FSMODE_FULLSCREEN) {
pWindow->m_vRealPosition = PMONITOR->vecPosition;
pWindow->m_vRealSize = PMONITOR->vecSize;
} else {
@@ -954,13 +929,7 @@ void CHyprMasterLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, eFullscree
}
}
- g_pCompositor->updateWindowAnimatedDecorationValues(pWindow);
-
- g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goal());
-
g_pCompositor->changeWindowZOrder(pWindow, true);
-
- recalculateMonitor(PMONITOR->ID);
}
void CHyprMasterLayout::recalculateWindow(PHLWINDOW pWindow) {
@@ -1081,14 +1050,14 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
if (!validMapped(PWINDOWTOCHANGETO))
return;
- if (header.pWindow->m_bIsFullscreen) {
+ if (header.pWindow->isFullscreen()) {
const auto PWORKSPACE = header.pWindow->m_pWorkspace;
- const auto FSMODE = PWORKSPACE->m_efFullscreenMode;
+ const auto FSMODE = header.pWindow->m_sFullscreenState.internal;
static auto INHERITFULLSCREEN = CConfigValue<Hyprlang::INT>("master:inherit_fullscreen");
- g_pCompositor->setWindowFullscreen(header.pWindow, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenInternal(header.pWindow, FSMODE_NONE);
g_pCompositor->focusWindow(PWINDOWTOCHANGETO);
if (*INHERITFULLSCREEN)
- g_pCompositor->setWindowFullscreen(PWINDOWTOCHANGETO, true, FSMODE);
+ g_pCompositor->setWindowFullscreenInternal(PWINDOWTOCHANGETO, FSMODE);
} else {
g_pCompositor->focusWindow(PWINDOWTOCHANGETO);
g_pCompositor->warpCursorTo(PWINDOWTOCHANGETO->middle());
@@ -1208,7 +1177,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
const auto PWINDOWTOSWAPWITH = getNextWindow(header.pWindow, true);
if (PWINDOWTOSWAPWITH) {
- g_pCompositor->setWindowFullscreen(header.pWindow, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenInternal(header.pWindow, FSMODE_NONE);
switchWindows(header.pWindow, PWINDOWTOSWAPWITH);
switchToWindow(header.pWindow);
}
@@ -1224,7 +1193,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
const auto PWINDOWTOSWAPWITH = getNextWindow(header.pWindow, false);
if (PWINDOWTOSWAPWITH) {
- g_pCompositor->setWindowFullscreen(header.pWindow, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenClient(header.pWindow, FSMODE_NONE);
switchWindows(header.pWindow, PWINDOWTOSWAPWITH);
switchToWindow(header.pWindow);
}
@@ -1243,7 +1212,8 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
if (MASTERS + 2 > WINDOWS && *SMALLSPLIT == 0)
return 0;
- g_pCompositor->setWindowFullscreen(header.pWindow, false, FULLSCREEN_FULL);
+
+ g_pCompositor->setWindowFullscreenInternal(header.pWindow, FSMODE_NONE);
if (!PNODE || PNODE->isMaster) {
// first non-master node
@@ -1275,7 +1245,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
if (WINDOWS < 2 || MASTERS < 2)
return 0;
- g_pCompositor->setWindowFullscreen(header.pWindow, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenInternal(header.pWindow, FSMODE_NONE);
if (!PNODE || !PNODE->isMaster) {
// first non-master node
@@ -1296,7 +1266,7 @@ std::any CHyprMasterLayout::layoutMessage(SLayoutMessageHeader header, std::stri
if (!PWINDOW)
return 0;
- g_pCompositor->setWindowFullscreen(PWINDOW, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenInternal(PWINDOW, FSMODE_NONE);
const auto PWORKSPACEDATA = getMasterWorkspaceData(PWINDOW->workspaceID());
@@ -1392,7 +1362,7 @@ void CHyprMasterLayout::runOrientationCycle(SLayoutMessageHeader& header, CVarLi
if (!PWINDOW)
return;
- g_pCompositor->setWindowFullscreen(PWINDOW, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenInternal(PWINDOW, FSMODE_NONE);
const auto PWORKSPACEDATA = getMasterWorkspaceData(PWINDOW->workspaceID());
diff --git a/src/layout/MasterLayout.hpp b/src/layout/MasterLayout.hpp
index 30d5b3cf..fdb916e5 100644
--- a/src/layout/MasterLayout.hpp
+++ b/src/layout/MasterLayout.hpp
@@ -58,7 +58,7 @@ class CHyprMasterLayout : public IHyprLayout {
virtual void recalculateMonitor(const int&);
virtual void recalculateWindow(PHLWINDOW);
virtual void resizeActiveWindow(const Vector2D&, eRectCorner corner = CORNER_NONE, PHLWINDOW pWindow = nullptr);
- virtual void fullscreenRequestForWindow(PHLWINDOW, eFullscreenMode, bool);
+ virtual void fullscreenRequestForWindow(PHLWINDOW pWindow, const eFullscreenMode CURRENT_EFFECTIVE_MODE, const eFullscreenMode EFFECTIVE_MODE);
virtual std::any layoutMessage(SLayoutMessageHeader, std::string);
virtual SWindowRenderLayoutHints requestRenderHints(PHLWINDOW);
virtual void switchWindows(PHLWINDOW, PHLWINDOW);
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 823e2d2e..33b07351 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -68,7 +68,7 @@ CKeybindManager::CKeybindManager() {
m_mDispatchers["workspace"] = changeworkspace;
m_mDispatchers["renameworkspace"] = renameWorkspace;
m_mDispatchers["fullscreen"] = fullscreenActive;
- m_mDispatchers["fakefullscreen"] = fakeFullscreenActive;
+ m_mDispatchers["fullscreenstate"] = fullscreenStateActive;
m_mDispatchers["movetoworkspace"] = moveActiveToWorkspace;
m_mDispatchers["movetoworkspacesilent"] = moveActiveToWorkspaceSilent;
m_mDispatchers["pseudo"] = toggleActivePseudo;
@@ -319,17 +319,17 @@ void CKeybindManager::switchToWindow(PHLWINDOW PWINDOWTOCHANGETO) {
// remove constraints
g_pInputManager->unconstrainMouse();
- if (PLASTWINDOW && PLASTWINDOW->m_pWorkspace == PWINDOWTOCHANGETO->m_pWorkspace && PLASTWINDOW->m_bIsFullscreen) {
+ if (PLASTWINDOW && PLASTWINDOW->m_pWorkspace == PWINDOWTOCHANGETO->m_pWorkspace && PLASTWINDOW->isFullscreen()) {
const auto PWORKSPACE = PLASTWINDOW->m_pWorkspace;
- const auto FSMODE = PWORKSPACE->m_efFullscreenMode;
+ const auto MODE = PWORKSPACE->m_efFullscreenMode;
if (!PWINDOWTOCHANGETO->m_bPinned)
- g_pCompositor->setWindowFullscreen(PLASTWINDOW, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenInternal(PLASTWINDOW, FSMODE_NONE);
g_pCompositor->focusWindow(PWINDOWTOCHANGETO);
if (!PWINDOWTOCHANGETO->m_bPinned)
- g_pCompositor->setWindowFullscreen(PWINDOWTOCHANGETO, true, FSMODE);
+ g_pCompositor->setWindowFullscreenInternal(PWINDOWTOCHANGETO, MODE);
} else {
updateRelativeCursorCoords();
g_pCompositor->focusWindow(PWINDOWTOCHANGETO);
@@ -996,7 +996,7 @@ void CKeybindManager::setActiveTiled(std::string args) {
void CKeybindManager::centerWindow(std::string args) {
const auto PWINDOW = g_pCompositor->m_pLastWindow.lock();
- if (!PWINDOW || !PWINDOW->m_bIsFloating || PWINDOW->m_bIsFullscreen)
+ if (!PWINDOW || !PWINDOW->m_bIsFloating || PWINDOW->isFullscreen())
return;
const auto PMONITOR = g_pCompositor->getMonitorFromID(PWINDOW->m_iMonitorID);
@@ -1022,7 +1022,7 @@ void CKeybindManager::toggleActivePseudo(std::string args) {
PWINDOW->m_bIsPseudotiled = !PWINDOW->m_bIsPseudotiled;
- if (!PWINDOW->m_bIsFullscreen)
+ if (!PWINDOW->isFullscreen())
g_pLayoutManager->getCurrentLayout()->recalculateWindow(PWINDOW);
}
@@ -1149,10 +1149,34 @@ void CKeybindManager::fullscreenActive(std::string args) {
if (!PWINDOW)
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);
+ const eFullscreenMode MODE = args == "1" ? FSMODE_MAXIMIZED : FSMODE_FULLSCREEN;
+
+ if (PWINDOW->isEffectiveInternalFSMode(MODE))
+ g_pCompositor->setWindowFullscreenInternal(PWINDOW, FSMODE_NONE);
+ else
+ g_pCompositor->setWindowFullscreenInternal(PWINDOW, MODE);
+}
+
+void CKeybindManager::fullscreenStateActive(std::string args) {
+ const auto PWINDOW = g_pCompositor->m_pLastWindow.lock();
+ const auto ARGS = CVarList(args, 2, ' ');
+
+ if (!PWINDOW)
+ return;
+
+ PWINDOW->m_sWindowData.syncFullscreen = CWindowOverridableVar(false, PRIORITY_SET_PROP);
+
+ int internalMode, clientMode;
+ try {
+ internalMode = std::stoi(ARGS[0]);
+ } catch (std::exception& e) { internalMode = -1; }
+ try {
+ clientMode = std::stoi(ARGS[1]);
+ } catch (std::exception& e) { clientMode = -1; }
+
+ g_pCompositor->setWindowFullscreenState(PWINDOW,
+ sFullscreenState{.internal = (internalMode != -1 ? (eFullscreenMode)internalMode : PWINDOW->m_sFullscreenState.internal),
+ .client = (clientMode != -1 ? (eFullscreenMode)clientMode : PWINDOW->m_sFullscreenState.client)});
}
void CKeybindManager::moveActiveToWorkspace(std::string args) {
@@ -1277,7 +1301,7 @@ void CKeybindManager::moveFocusTo(std::string args) {
return;
}
- const auto PWINDOWTOCHANGETO = *PFULLCYCLE && PLASTWINDOW->m_bIsFullscreen ?
+ const auto PWINDOWTOCHANGETO = *PFULLCYCLE && PLASTWINDOW->isFullscreen() ?
(arg == 'd' || arg == 'b' || arg == 'r' ? g_pCompositor->getNextWindowOnWorkspace(PLASTWINDOW, true) : g_pCompositor->getPrevWindowOnWorkspace(PLASTWINDOW, true)) :
g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
@@ -1334,7 +1358,7 @@ void CKeybindManager::swapActive(std::string args) {
Debug::log(LOG, "Swapping active window in direction {}", arg);
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow.lock();
- if (!PLASTWINDOW || PLASTWINDOW->m_bIsFullscreen)
+ if (!PLASTWINDOW || PLASTWINDOW->isFullscreen())
return;
const auto PWINDOWTOCHANGETO = g_pCompositor->getWindowInDirection(PLASTWINDOW, arg);
@@ -1372,7 +1396,7 @@ void CKeybindManager::moveActiveTo(std::string args) {
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow.lock();
- if (!PLASTWINDOW || PLASTWINDOW->m_bIsFullscreen)
+ if (!PLASTWINDOW || PLASTWINDOW->isFullscreen())
return;
if (PLASTWINDOW->m_bIsFloating) {
@@ -1427,7 +1451,8 @@ void CKeybindManager::toggleGroup(std::string args) {
if (!PWINDOW)
return;
- g_pCompositor->setWindowFullscreen(PWINDOW, false, FULLSCREEN_FULL);
+ if (PWINDOW->isFullscreen())
+ g_pCompositor->setWindowFullscreenInternal(PWINDOW, FSMODE_NONE);
if (PWINDOW->m_sGroupData.pNextWindow.expired())
PWINDOW->createGroup();
@@ -1819,7 +1844,7 @@ void CKeybindManager::forceRendererReload(std::string args) {
void CKeybindManager::resizeActive(std::string args) {
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow.lock();
- if (!PLASTWINDOW || PLASTWINDOW->m_bIsFullscreen)
+ if (!PLASTWINDOW || PLASTWINDOW->isFullscreen())
return;
const auto SIZ = g_pCompositor->parseWindowVectorArgsRelative(args, PLASTWINDOW->m_vRealSize.goal());
@@ -1836,7 +1861,7 @@ void CKeybindManager::resizeActive(std::string args) {
void CKeybindManager::moveActive(std::string args) {
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow.lock();
- if (!PLASTWINDOW || PLASTWINDOW->m_bIsFullscreen)
+ if (!PLASTWINDOW || PLASTWINDOW->isFullscreen())
return;
const auto POS = g_pCompositor->parseWindowVectorArgsRelative(args, PLASTWINDOW->m_vRealPosition.goal());
@@ -1856,7 +1881,7 @@ void CKeybindManager::moveWindow(std::string args) {
return;
}
- if (PWINDOW->m_bIsFullscreen)
+ if (PWINDOW->isFullscreen())
return;
const auto POS = g_pCompositor->parseWindowVectorArgsRelative(MOVECMD, PWINDOW->m_vRealPosition.goal());
@@ -1876,7 +1901,7 @@ void CKeybindManager::resizeWindow(std::string args) {
return;
}
- if (PWINDOW->m_bIsFullscreen)
+ if (PWINDOW->isFullscreen())
return;
const auto SIZ = g_pCompositor->parseWindowVectorArgsRelative(MOVECMD, PWINDOW->m_vRealSize.goal());
@@ -1953,12 +1978,12 @@ void CKeybindManager::focusWindow(std::string regexp) {
g_pCompositor->focusWindow(PWINDOW);
} else {
if (FSWINDOW != PWINDOW && !PWINDOW->m_bPinned)
- g_pCompositor->setWindowFullscreen(FSWINDOW, false, FULLSCREEN_FULL);
+ g_pCompositor->setWindowFullscreenClient(FSWINDOW, FSMODE_NONE);
g_pCompositor->focusWindow(PWINDOW);
if (FSWINDOW != PWINDOW && !PWINDOW->m_bPinned)
- g_pCompositor->setWindowFullscreen(PWINDOW, true, FSMODE);
+ g_pCompositor->setWindowFullscreenClient(PWINDOW, FSMODE);
}
} else
g_pCompositor->focusWindow(PWINDOW);
@@ -2330,7 +2355,7 @@ void CKeybindManager::pinActive(std::string args) {
return;
}
- if (!PWINDOW->m_bIsFloating || PWINDOW->m_bIsFullscreen)
+ if (!PWINDOW->m_bIsFloating || PWINDOW->isFullscreen())
return;
PWINDOW->m_bPinned = !PWINDOW->m_bPinned;
@@ -2388,7 +2413,7 @@ void CKeybindManager::changeMouseBindMode(const eMouseBindMode MODE) {
if (!PWINDOW)
return;
- if (!PWINDOW->m_bIsFullscreen && MODE == MBIND_MOVE)
+ if (!PWINDOW->isFullscreen() && MODE == MBIND_MOVE)
PWINDOW->checkInputOnDecos(INPUT_TYPE_DRAG_START, MOUSECOORDS);
if (g_pInputManager->currentlyDraggedWindow.expired())
@@ -2436,14 +2461,6 @@ void CKeybindManager::alterZOrder(std::string args) {
g_pInputManager->simulateMouseMovement();
}
-void CKeybindManager::fakeFullscreenActive(std::string args) {
- if (!g_pCompositor->m_pLastWindow.expired()) {
- // will also set the flag
- g_pCompositor->m_pLastWindow->m_bFakeFullscreenState = !g_pCompositor->m_pLastWindow->m_bFakeFullscreenState;
- g_pXWaylandManager->setWindowFullscreen(g_pCompositor->m_pLastWindow.lock(), g_pCompositor->m_pLastWindow->shouldSendFullscreenState());
- }
-}
-
void CKeybindManager::lockGroups(std::string args) {
if (args == "lock" || args.empty() || args == "lockgroups")
g_pKeybindManager->m_bGroupsLocked = true;
@@ -2603,7 +2620,7 @@ void CKeybindManager::moveWindowOrGroup(std::string args) {
}
const auto PWINDOW = g_pCompositor->m_pLastWindow.lock();
- if (!PWINDOW || PWINDOW->m_bIsFullscreen)
+ if (!PWINDOW || PWINDOW->isFullscreen())
return;
if (!*PIGNOREGROUPLOCK && g_pKeybindManager->m_bGroupsLocked) {
diff --git a/src/managers/KeybindManager.hpp b/src/managers/KeybindManager.hpp
index 26a6345b..26b42b00 100644
--- a/src/managers/KeybindManager.hpp
+++ b/src/managers/KeybindManager.hpp
@@ -155,7 +155,7 @@ class CKeybindManager {
static void setActiveTiled(std::string);
static void changeworkspace(std::string);
static void fullscreenActive(std::string);
- static void fakeFullscreenActive(std::string);
+ static void fullscreenStateActive(std::string args);
static void moveActiveToWorkspace(std::string);
static void moveActiveToWorkspaceSilent(std::string);
static void moveFocusTo(std::string);
diff --git a/src/managers/input/IdleInhibitor.cpp b/src/managers/input/IdleInhibitor.cpp
index da2429bc..2c335a7e 100644
--- a/src/managers/input/IdleInhibitor.cpp
+++ b/src/managers/input/IdleInhibitor.cpp
@@ -63,7 +63,7 @@ void CInputManager::recheckIdleInhibitorStatus() {
return;
}
- if (w->m_eIdleInhibitMode == IDLEINHIBIT_FULLSCREEN && w->m_bIsFullscreen && g_pCompositor->isWorkspaceVisible(w->m_pWorkspace)) {
+ if (w->m_eIdleInhibitMode == IDLEINHIBIT_FULLSCREEN && w->isFullscreen() && g_pCompositor->isWorkspaceVisible(w->m_pWorkspace)) {
PROTO::idle->setInhibit(true);
return;
}
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 014de40a..8c38893f 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -298,7 +298,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
// then, we check if the workspace doesnt have a fullscreen window
const auto PWORKSPACE = PMONITOR->activeWorkspace;
- if (PWORKSPACE->m_bHasFullscreenWindow && !foundSurface && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) {
+ if (PWORKSPACE->m_bHasFullscreenWindow && !foundSurface && PWORKSPACE->m_efFullscreenMode == FSMODE_FULLSCREEN) {
pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
if (!pFoundWindow) {
@@ -325,7 +325,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
// then windows
if (!foundSurface) {
- if (PWORKSPACE->m_bHasFullscreenWindow && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) {
+ if (PWORKSPACE->m_bHasFullscreenWindow && PWORKSPACE->m_efFullscreenMode == FSMODE_MAXIMIZED) {
if (!foundSurface) {
if (PMONITOR->activeSpecialWorkspace) {
pFoundWindow = g_pCompositor->vectorToWindowUnified(mouseCoords, RESERVED_EXTENTS | INPUT_EXTENTS | ALLOW_FLOATING);
@@ -470,7 +470,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
else if (pFoundWindow) {
// change cursor icon if hovering over border
if (*PRESIZEONBORDER && *PRESIZECURSORICON) {
- if (!pFoundWindow->m_bIsFullscreen && !pFoundWindow->hasPopupAt(mouseCoords)) {
+ if (!pFoundWindow->isFullscreen() && !pFoundWindow->hasPopupAt(mouseCoords)) {
setCursorIconOnBorder(pFoundWindow);
} else if (m_eBorderIconDirection != BORDERICON_NONE) {
unsetCursorImage();
@@ -681,7 +681,7 @@ void CInputManager::processMouseDownNormal(const IPointer::SButtonEvent& e) {
// clicking on border triggers resize
// TODO detect click on LS properly
if (*PRESIZEONBORDER && !m_bLastFocusOnLS && e.state == WL_POINTER_BUTTON_STATE_PRESSED && (!w || w->m_iX11Type != 2)) {
- if (w && !w->m_bIsFullscreen) {
+ if (w && !w->isFullscreen()) {
const CBox real = {w->m_vRealPosition.value().x, w->m_vRealPosition.value().y, w->m_vRealSize.value().x, w->m_vRealSize.value().y};
const CBox grab = {real.x - BORDER_GRAB_AREA, real.y - BORDER_GRAB_AREA, real.width + 2 * BORDER_GRAB_AREA, real.height + 2 * BORDER_GRAB_AREA};
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index 775881cd..c0e6c4f0 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -194,7 +194,7 @@ void CInputManager::endWorkspaceSwipe() {
// apply alpha
for (auto& ls : g_pCompositor->m_pLastMonitor->m_aLayerSurfaceLayers[2]) {
- ls->alpha = pSwitchedTo->m_bHasFullscreenWindow && pSwitchedTo->m_efFullscreenMode == FULLSCREEN_FULL ? 0.f : 1.f;
+ ls->alpha = pSwitchedTo->m_bHasFullscreenWindow && pSwitchedTo->m_efFullscreenMode == FSMODE_FULLSCREEN ? 0.f : 1.f;
}
}
diff --git a/src/protocols/ForeignToplevelWlr.cpp b/src/protocols/ForeignToplevelWlr.cpp
index 2b378386..295834ea 100644
--- a/src/protocols/ForeignToplevelWlr.cpp
+++ b/src/protocols/ForeignToplevelWlr.cpp
@@ -51,7 +51,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
}
}
- g_pCompositor->setWindowFullscreen(PWINDOW, true, FULLSCREEN_FULL);
+ g_pCompositor->changeWindowFullscreenModeClient(PWINDOW, FSMODE_FULLSCREEN, true);
g_pHyprRenderer->damageWindow(PWINDOW);
});
@@ -64,7 +64,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
if (PWINDOW->m_eSuppressedEvents & SUPPRESS_FULLSCREEN)
return;
- g_pCompositor->setWindowFullscreen(PWINDOW, false);
+ g_pCompositor->changeWindowFullscreenModeClient(PWINDOW, FSMODE_FULLSCREEN, false);
});
resource->setSetMaximized([this](CZwlrForeignToplevelHandleV1* p) {
@@ -81,7 +81,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
return;
}
- g_pCompositor->setWindowFullscreen(PWINDOW, true, FULLSCREEN_MAXIMIZED);
+ g_pCompositor->changeWindowFullscreenModeClient(PWINDOW, FSMODE_MAXIMIZED, true);
});
resource->setUnsetMaximized([this](CZwlrForeignToplevelHandleV1* p) {
@@ -93,7 +93,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
if (PWINDOW->m_eSuppressedEvents & SUPPRESS_MAXIMIZE)
return;
- g_pCompositor->setWindowFullscreen(PWINDOW, false);
+ g_pCompositor->changeWindowFullscreenModeClient(PWINDOW, FSMODE_MAXIMIZED, false);
});
resource->setClose([this](CZwlrForeignToplevelHandleV1* p) {
@@ -155,9 +155,9 @@ void CForeignToplevelHandleWlr::sendState() {
*p = ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_ACTIVATED;
}
- if (PWINDOW->m_bIsFullscreen) {
+ if (PWINDOW->isFullscreen()) {
auto p = (uint32_t*)wl_array_add(&state, sizeof(uint32_t));
- if (PWINDOW->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL)
+ if (PWINDOW->isEffectiveInternalFSMode(FSMODE_FULLSCREEN))
*p = ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_FULLSCREEN;
else
*p = ZWLR_FOREIGN_TOPLEVEL_HANDLE_V1_STATE_MAXIMIZED;
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index b5397598..e4f97895 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -269,7 +269,7 @@ bool CHyprRenderer::shouldRenderWindow(PHLWINDOW pWindow, CMonitor* pMonitor) {
return true;
// if hidden behind fullscreen
- if (PWINDOWWORKSPACE->m_bHasFullscreenWindow && !pWindow->m_bIsFullscreen && (!pWindow->m_bIsFloating || !pWindow->m_bCreatedOverFullscreen) &&
+ if (PWINDOWWORKSPACE->m_bHasFullscreenWindow && !pWindow->isFullscreen() && (!pWindow->m_bIsFloating || !pWindow->m_bCreatedOverFullscreen) &&
pWindow->m_fAlpha.value() == 0)
return false;
@@ -285,7 +285,7 @@ bool CHyprRenderer::shouldRenderWindow(PHLWINDOW pWindow, CMonitor* pMonitor) {
// if not, check if it maybe is active on a different monitor.
if (g_pCompositor->isWorkspaceVisible(pWindow->m_pWorkspace) && pWindow->m_bIsFloating /* tiled windows can't be multi-ws */)
- return !pWindow->m_bIsFullscreen; // Do not draw fullscreen windows on other monitors
+ return !pWindow->isFullscreen(); // Do not draw fullscreen windows on other monitors
if (pMonitor->activeSpecialWorkspace == pWindow->m_pWorkspace)
return true;
@@ -352,7 +352,7 @@ void CHyprRenderer::renderWorkspaceWindowsFullscreen(CMonitor* pMonitor, PHLWORK
if (w->m_fAlpha.value() == 0.f)
continue;
- if (w->m_bIsFullscreen || w->m_bIsFloating)
+ if (w->isFullscreen() || w->m_bIsFloating)
continue;
if (pWorkspace->m_bIsSpecialWorkspace != w->onSpecialWorkspace())
@@ -369,7 +369,7 @@ void CHyprRenderer::renderWorkspaceWindowsFullscreen(CMonitor* pMonitor, PHLWORK
if (w->m_fAlpha.value() == 0.f)
continue;
- if (w->m_bIsFullscreen || !w->m_bIsFloating)
+ if (w->isFullscreen() || !w->m_bIsFloating)
continue;
if (w->m_iMonitorID == pWorkspace->m_iMonitorID && pWorkspace->m_bIsSpecialWorkspace != w->onSpecialWorkspace())
@@ -385,7 +385,7 @@ void CHyprRenderer::renderWorkspaceWindowsFullscreen(CMonitor* pMonitor, PHLWORK
for (auto& w : g_pCompositor->m_vWindows) {
const auto PWORKSPACE = w->m_pWorkspace;
- if (w->m_pWorkspace != pWorkspace || !w->m_bIsFullscreen) {
+ if (w->m_pWorkspace != pWorkspace || !w->isFullscreen()) {
if (!(PWORKSPACE && (PWORKSPACE->m_vRenderOffset.isBeingAnimated() || PWORKSPACE->m_fAlpha.isBeingAnimated() || PWORKSPACE->m_bForceRendering)))
continue;
@@ -393,14 +393,14 @@ void CHyprRenderer::renderWorkspaceWindowsFullscreen(CMonitor* pMonitor, PHLWORK
continue;
}
- if (!w->m_bIsFullscreen)
+ if (!w->isFullscreen())
continue;
if (w->m_iMonitorID == pWorkspace->m_iMonitorID && pWorkspace->m_bIsSpecialWorkspace != w->onSpecialWorkspace())
continue;
if (shouldRenderWindow(w, pMonitor))
- renderWindow(w, pMonitor, time, pWorkspace->m_efFullscreenMode != FULLSCREEN_FULL, RENDER_PASS_ALL);
+ renderWindow(w, pMonitor, time, pWorkspace->m_efFullscreenMode != FSMODE_FULLSCREEN, RENDER_PASS_ALL);
if (w->m_pWorkspace != pWorkspace)
continue;
@@ -416,7 +416,7 @@ void CHyprRenderer::renderWorkspaceWindowsFullscreen(CMonitor* pMonitor, PHLWORK
// then render windows over fullscreen.
for (auto& w : g_pCompositor->m_vWindows) {
- if (w->m_pWorkspace != pWorkspaceWindow->m_pWorkspace || (!w->m_bCreatedOverFullscreen && !w->m_bPinned) || (!w->m_bIsMapped && !w->m_bFadingOut) || w->m_bIsFullscreen)
+ if (w->m_pWorkspace != pWorkspaceWindow->m_pWorkspace || (!w->m_bCreatedOverFullscreen && !w->m_bPinned) || (!w->m_bIsMapped && !w->m_bFadingOut) || w->isFullscreen())
continue;
if (w->m_iMonitorID == pWorkspace->m_iMonitorID && pWorkspace->m_bIsSpecialWorkspace != w->onSpecialWorkspace())
@@ -538,10 +538,10 @@ void CHyprRenderer::renderWindow(PHLWINDOW pWindow, CMonitor* pMonitor, timespec
decorate = false;
renderdata.surface = pWindow->m_pWLSurface->resource();
- renderdata.dontRound = (pWindow->m_bIsFullscreen && PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) || pWindow->m_sWindowData.noRounding.valueOrDefault();
+ renderdata.dontRound = pWindow->isEffectiveInternalFSMode(FSMODE_FULLSCREEN) || pWindow->m_sWindowData.noRounding.valueOrDefault();
renderdata.fadeAlpha = pWindow->m_fAlpha.value() * (pWindow->m_bPinned ? 1.f : PWORKSPACE->m_fAlpha.value());
renderdata.alpha = pWindow->m_fActiveInactiveAlpha.value();
- renderdata.decorate = decorate && !pWindow->m_bX11DoesntWantBorders && (!pWindow->m_bIsFullscreen || PWORKSPACE->m_efFullscreenMode != FULLSCREEN_FULL);
+ renderdata.decorate = decorate && !pWindow->m_bX11DoesntWantBorders && !pWindow->isEffectiveInternalFSMode(FSMODE_FULLSCREEN);
renderdata.rounding = ignoreAllGeometry || renderdata.dontRound ? 0 : pWindow->rounding() * pMonitor->scale;
renderdata.blur = !ignoreAllGeometry; // if it shouldn't, it will be ignored later
renderdata.pWindow = pWindow;
@@ -568,7 +568,7 @@ void CHyprRenderer::renderWindow(PHLWINDOW pWindow, CMonitor* pMonitor, timespec
renderdata.y += pWindow->m_vFloatingOffset.y;
// if window is floating and we have a slide animation, clip it to its full bb
- if (!ignorePosition && pWindow->m_bIsFloating && !pWindow->m_bIsFullscreen && PWORKSPACE->m_vRenderOffset.isBeingAnimated() && !pWindow->m_bPinned) {
+ if (!ignorePosition && pWindow->m_bIsFloating && !pWindow->isFullscreen() && PWORKSPACE->m_vRenderOffset.isBeingAnimated() && !pWindow->m_bPinned) {
CRegion rg =
pWindow->getFullWindowBoundingBox().translate(-pMonitor->vecPosition + PWORKSPACE->m_vRenderOffset.value() + pWindow->m_vFloatingOffset).scale(pMonitor->scale);
g_pHyprOpenGL->m_RenderData.clipBox = rg.getExtents();
@@ -871,7 +871,7 @@ void CHyprRenderer::renderAllClientsForWorkspace(CMonitor* pMonitor, PHLWORKSPAC
// if we have a fullscreen, opaque window that convers the screen, we can skip this.
// TODO: check better with solitary after MR for tearing.
const auto PFULLWINDOW = pWorkspace ? g_pCompositor->getFullscreenWindowOnWorkspace(pWorkspace->m_iID) : nullptr;
- if (!pWorkspace->m_bHasFullscreenWindow || pWorkspace->m_efFullscreenMode != FULLSCREEN_FULL || !PFULLWINDOW || PFULLWINDOW->m_vRealSize.isBeingAnimated() ||
+ if (!pWorkspace->m_bHasFullscreenWindow || pWorkspace->m_efFullscreenMode != FSMODE_FULLSCREEN || !PFULLWINDOW || PFULLWINDOW->m_vRealSize.isBeingAnimated() ||
!PFULLWINDOW->opaque() || pWorkspace->m_vRenderOffset.value() != Vector2D{} || g_pHyprOpenGL->preBlurQueued()) {
if (!g_pHyprOpenGL->m_RenderData.pCurrentMonData->blurFBShouldRender)
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp
index a13750d0..8163a8c1 100644
--- a/src/render/decorations/CHyprGroupBarDecoration.cpp
+++ b/src/render/decorations/CHyprGroupBarDecoration.cpp
@@ -464,7 +464,7 @@ bool CHyprGroupBarDecoration::onEndWindowDragOnDeco(const Vector2D& pos, PHLWIND
bool CHyprGroupBarDecoration::onMouseButtonOnDeco(const Vector2D& pos, const IPointer::SButtonEvent& e) {
static auto PSTACKED = CConfigValue<Hyprlang::INT>("group:groupbar:stacked");
- if (m_pWindow->m_bIsFullscreen && m_pWindow->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_FULL)
+ if (m_pWindow->isEffectiveInternalFSMode(FSMODE_FULLSCREEN))
return true;
const float BARRELATIVEX = pos.x - assignedBoxGlobal().x;