From 7439246efbe8e0c14bd6f8391022499a90554550 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 30 Mar 2022 17:39:04 +0200 Subject: [PATCH] tell windows to fullscreen on keybind --- src/managers/KeybindManager.cpp | 2 ++ src/managers/XWaylandManager.cpp | 8 ++++++++ src/managers/XWaylandManager.hpp | 1 + 3 files changed, 11 insertions(+) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 6224b561..a421e6eb 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -176,6 +176,8 @@ void CKeybindManager::fullscreenActive(std::string args) { return; g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(PWINDOW); + + g_pXWaylandManager->setWindowFullscreen(PWINDOW, PWINDOW->m_bIsFullscreen); } void CKeybindManager::moveActiveToWorkspace(std::string args) { diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index 9bdd992b..6fd37f94 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -174,4 +174,12 @@ void CHyprXWaylandManager::checkBorders(CWindow* pWindow) { if (pWindow->m_uSurface.xwayland->parent) { pWindow->m_bX11DoesntWantBorders = true; } +} + +void CHyprXWaylandManager::setWindowFullscreen(CWindow* pWindow, bool fullscreen) { + if (pWindow->m_bIsX11) { + wlr_xwayland_surface_set_fullscreen(pWindow->m_uSurface.xwayland, fullscreen); + } else { + wlr_xdg_toplevel_set_fullscreen(pWindow->m_uSurface.xdg->toplevel, fullscreen); + } } \ No newline at end of file diff --git a/src/managers/XWaylandManager.hpp b/src/managers/XWaylandManager.hpp index 00de8139..143d60da 100644 --- a/src/managers/XWaylandManager.hpp +++ b/src/managers/XWaylandManager.hpp @@ -18,6 +18,7 @@ public: void sendCloseWindow(CWindow*); void setWindowSize(CWindow*, const Vector2D&); void setWindowStyleTiled(CWindow*, uint32_t); + void setWindowFullscreen(CWindow*, bool); wlr_surface* surfaceAt(CWindow*, const Vector2D&, Vector2D&); bool shouldBeFloated(CWindow*); void moveXWaylandWindow(CWindow*, const Vector2D&);