mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 13:25:59 +01:00
Add windowrule fakeFullScreen (#2043)
Co-authored-by: xVermillionx <xVermillionx@notvalid>
This commit is contained in:
parent
a4330fe378
commit
e446db02f6
2 changed files with 17 additions and 10 deletions
|
@ -785,8 +785,8 @@ bool windowRuleValid(const std::string& RULE) {
|
||||||
return !(RULE != "float" && RULE != "tile" && RULE.find("opacity") != 0 && RULE.find("move") != 0 && RULE.find("size") != 0 && RULE.find("minsize") != 0 &&
|
return !(RULE != "float" && RULE != "tile" && RULE.find("opacity") != 0 && RULE.find("move") != 0 && RULE.find("size") != 0 && RULE.find("minsize") != 0 &&
|
||||||
RULE.find("maxsize") != 0 && RULE.find("pseudo") != 0 && RULE.find("monitor") != 0 && RULE.find("idleinhibit") != 0 && RULE != "nofocus" && RULE != "noblur" &&
|
RULE.find("maxsize") != 0 && RULE.find("pseudo") != 0 && RULE.find("monitor") != 0 && RULE.find("idleinhibit") != 0 && RULE != "nofocus" && RULE != "noblur" &&
|
||||||
RULE != "noshadow" && RULE != "noborder" && RULE != "center" && RULE != "opaque" && RULE != "forceinput" && RULE != "fullscreen" && RULE != "nofullscreenrequest" &&
|
RULE != "noshadow" && RULE != "noborder" && RULE != "center" && RULE != "opaque" && RULE != "forceinput" && RULE != "fullscreen" && RULE != "nofullscreenrequest" &&
|
||||||
RULE != "nomaxsize" && RULE != "pin" && RULE != "noanim" && RULE != "dimaround" && RULE != "windowdance" && RULE != "maximize" && RULE.find("animation") != 0 &&
|
RULE != "fakefullscreen" && RULE != "nomaxsize" && RULE != "pin" && RULE != "noanim" && RULE != "dimaround" && RULE != "windowdance" && RULE != "maximize" &&
|
||||||
RULE.find("rounding") != 0 && RULE.find("workspace") != 0 && RULE.find("bordercolor") != 0 && RULE != "forcergbx");
|
RULE.find("animation") != 0 && RULE.find("rounding") != 0 && RULE.find("workspace") != 0 && RULE.find("bordercolor") != 0 && RULE != "forcergbx");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool layerRuleValid(const std::string& RULE) {
|
bool layerRuleValid(const std::string& RULE) {
|
||||||
|
|
|
@ -114,6 +114,7 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
bool requestsFullscreen = PWINDOW->m_bWantsInitialFullscreen ||
|
bool requestsFullscreen = PWINDOW->m_bWantsInitialFullscreen ||
|
||||||
(!PWINDOW->m_bIsX11 && PWINDOW->m_uSurface.xdg->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL && PWINDOW->m_uSurface.xdg->toplevel->requested.fullscreen) ||
|
(!PWINDOW->m_bIsX11 && PWINDOW->m_uSurface.xdg->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL && PWINDOW->m_uSurface.xdg->toplevel->requested.fullscreen) ||
|
||||||
(PWINDOW->m_bIsX11 && PWINDOW->m_uSurface.xwayland->fullscreen);
|
(PWINDOW->m_bIsX11 && PWINDOW->m_uSurface.xwayland->fullscreen);
|
||||||
|
bool requestsFakeFullscreen = requestsFullscreen;
|
||||||
bool requestsMaximize = false;
|
bool requestsMaximize = false;
|
||||||
bool shouldFocus = true;
|
bool shouldFocus = true;
|
||||||
bool workspaceSpecial = false;
|
bool workspaceSpecial = false;
|
||||||
|
@ -182,6 +183,8 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
PWINDOW->m_bNoFullscreenRequest = true;
|
PWINDOW->m_bNoFullscreenRequest = true;
|
||||||
} else if (r.szRule == "fullscreen") {
|
} else if (r.szRule == "fullscreen") {
|
||||||
requestsFullscreen = true;
|
requestsFullscreen = true;
|
||||||
|
} else if (r.szRule == "fakefullscreen") {
|
||||||
|
requestsFakeFullscreen = true;
|
||||||
} else if (r.szRule == "windowdance") {
|
} else if (r.szRule == "windowdance") {
|
||||||
PWINDOW->m_sAdditionalConfigData.windowDanceCompat = true;
|
PWINDOW->m_sAdditionalConfigData.windowDanceCompat = true;
|
||||||
} else if (r.szRule == "nomaxsize") {
|
} else if (r.szRule == "nomaxsize") {
|
||||||
|
@ -476,18 +479,22 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
PWINDOW->m_vRealPosition.setCallbackOnEnd(setAnimToMove);
|
PWINDOW->m_vRealPosition.setCallbackOnEnd(setAnimToMove);
|
||||||
PWINDOW->m_vRealSize.setCallbackOnEnd(setAnimToMove);
|
PWINDOW->m_vRealSize.setCallbackOnEnd(setAnimToMove);
|
||||||
|
|
||||||
if ((requestsFullscreen || requestsMaximize) && !PWINDOW->m_bNoFullscreenRequest) {
|
if ((requestsFullscreen || requestsMaximize || requestsFakeFullscreen) && !PWINDOW->m_bNoFullscreenRequest) {
|
||||||
// fix fullscreen on requested (basically do a switcheroo)
|
// fix fullscreen on requested (basically do a switcheroo)
|
||||||
if (PWORKSPACE->m_bHasFullscreenWindow) {
|
if (PWORKSPACE->m_bHasFullscreenWindow) {
|
||||||
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
|
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
|
||||||
g_pCompositor->setWindowFullscreen(PFULLWINDOW, false, FULLSCREEN_FULL);
|
g_pCompositor->setWindowFullscreen(PFULLWINDOW, false, FULLSCREEN_FULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requestsFakeFullscreen && !PWINDOW->m_bFakeFullscreenState) {
|
||||||
|
PWINDOW->m_bFakeFullscreenState = !PWINDOW->m_bFakeFullscreenState;
|
||||||
|
g_pXWaylandManager->setWindowFullscreen(PWINDOW, true);
|
||||||
|
} else {
|
||||||
PWINDOW->m_vRealPosition.warp();
|
PWINDOW->m_vRealPosition.warp();
|
||||||
PWINDOW->m_vRealSize.warp();
|
PWINDOW->m_vRealSize.warp();
|
||||||
|
|
||||||
g_pCompositor->setWindowFullscreen(PWINDOW, true, requestsFullscreen ? FULLSCREEN_FULL : FULLSCREEN_MAXIMIZED);
|
g_pCompositor->setWindowFullscreen(PWINDOW, true, requestsFullscreen ? FULLSCREEN_FULL : FULLSCREEN_MAXIMIZED);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pFullscreenWindow && workspaceSilent) {
|
if (pFullscreenWindow && workspaceSilent) {
|
||||||
g_pCompositor->setWindowFullscreen(pFullscreenWindow, true, PWORKSPACE->m_efFullscreenMode);
|
g_pCompositor->setWindowFullscreen(pFullscreenWindow, true, PWORKSPACE->m_efFullscreenMode);
|
||||||
|
|
Loading…
Reference in a new issue