From c96aee5740a9b4f70069cccfba3558f954d7212f Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 15 Nov 2024 20:45:56 +0200 Subject: [PATCH] WindowServer: Make mod+f toggle focused window fullscreen state --- userspace/programs/WindowServer/WindowServer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/userspace/programs/WindowServer/WindowServer.cpp b/userspace/programs/WindowServer/WindowServer.cpp index bb67225c..b18936f8 100644 --- a/userspace/programs/WindowServer/WindowServer.cpp +++ b/userspace/programs/WindowServer/WindowServer.cpp @@ -352,6 +352,15 @@ void WindowServer::on_key_event(LibInput::KeyEvent event) return; } + if (m_is_mod_key_held && event.pressed() && event.key == LibInput::Key::F) + { + if (!m_focused_window) + return; + m_is_fullscreen_window = !m_is_fullscreen_window; + invalidate(m_framebuffer.area()); + return; + } + // Toggle window bounce with F2 if (!m_is_fullscreen_window && event.pressed() && event.key == LibInput::Key::F2) m_is_bouncing_window = !m_is_bouncing_window;