mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-10 07:45:59 +01:00
handle maximize toplevel request
This commit is contained in:
parent
dcf5e34bfa
commit
ead0e74471
2 changed files with 11 additions and 3 deletions
|
@ -1616,6 +1616,15 @@ void CCompositor::setWindowFullscreen(CWindow* pWindow, bool on, eFullscreenMode
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto PMONITOR = getMonitorFromID(pWindow->m_iMonitorID);
|
||||||
|
|
||||||
|
const auto PWORKSPACE = getWorkspaceByID(pWindow->m_iWorkspaceID);
|
||||||
|
|
||||||
|
if (PWORKSPACE->m_bHasFullscreenWindow && on) {
|
||||||
|
Debug::log(LOG, "Rejecting fullscreen ON on a fullscreen workspace");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(pWindow, mode, on);
|
g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(pWindow, mode, on);
|
||||||
|
|
||||||
g_pXWaylandManager->setWindowFullscreen(pWindow, pWindow->m_bIsFullscreen && mode == FULLSCREEN_FULL);
|
g_pXWaylandManager->setWindowFullscreen(pWindow, pWindow->m_bIsFullscreen && mode == FULLSCREEN_FULL);
|
||||||
|
@ -1629,8 +1638,6 @@ void CCompositor::setWindowFullscreen(CWindow* pWindow, bool on, eFullscreenMode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto PMONITOR = getMonitorFromID(pWindow->m_iMonitorID);
|
|
||||||
|
|
||||||
for (auto& ls : PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_TOP]) {
|
for (auto& ls : PMONITOR->m_aLayerSurfaceLists[ZWLR_LAYER_SHELL_V1_LAYER_TOP]) {
|
||||||
if (!ls->fadingOut)
|
if (!ls->fadingOut)
|
||||||
ls->alpha = pWindow->m_bIsFullscreen && mode == FULLSCREEN_FULL ? 0.f : 255.f;
|
ls->alpha = pWindow->m_bIsFullscreen && mode == FULLSCREEN_FULL ? 0.f : 255.f;
|
||||||
|
|
|
@ -705,7 +705,8 @@ void Events::listener_NewXDGDeco(wl_listener* listener, void* data) {
|
||||||
void Events::listener_requestMaximize(void* owner, void* data) {
|
void Events::listener_requestMaximize(void* owner, void* data) {
|
||||||
const auto PWINDOW = (CWindow*)owner;
|
const auto PWINDOW = (CWindow*)owner;
|
||||||
|
|
||||||
// ignore
|
g_pCompositor->setWindowFullscreen(PWINDOW, !PWINDOW->m_bIsFullscreen, FULLSCREEN_MAXIMIZED); // this will be rejected if there already is a fullscreen window
|
||||||
|
|
||||||
wlr_xdg_surface_schedule_configure(PWINDOW->m_uSurface.xdg);
|
wlr_xdg_surface_schedule_configure(PWINDOW->m_uSurface.xdg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue