diff --git a/src/Compositor.cpp b/src/Compositor.cpp index f670a643..e3392483 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1616,6 +1616,15 @@ void CCompositor::setWindowFullscreen(CWindow* pWindow, bool on, eFullscreenMode 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_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]) { if (!ls->fadingOut) ls->alpha = pWindow->m_bIsFullscreen && mode == FULLSCREEN_FULL ? 0.f : 255.f; diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index b67a8619..8e6aed25 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -705,7 +705,8 @@ void Events::listener_NewXDGDeco(wl_listener* listener, void* data) { void Events::listener_requestMaximize(void* owner, void* data) { 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); }