From 268e21076e1cb06af9142aa193dcc8647bf0eb60 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 12 Feb 2024 09:03:59 -0700 Subject: [PATCH] sctk: add command to set maximize state --- sctk/src/commands/window.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sctk/src/commands/window.rs b/sctk/src/commands/window.rs index 9f3bb0dd52..dc591cdd73 100644 --- a/sctk/src/commands/window.rs +++ b/sctk/src/commands/window.rs @@ -55,6 +55,18 @@ pub fn start_drag_window(id: window::Id) -> Command { )) } +pub fn maximize(id: window::Id, maximized: bool) -> Command { + Command::single(command::Action::PlatformSpecific( + platform_specific::Action::Wayland(wayland::Action::Window( + if maximized { + wayland::window::Action::Maximize { id } + } else { + wayland::window::Action::UnsetMaximize { id } + }, + )), + )) +} + pub fn toggle_maximize(id: window::Id) -> Command { Command::single(command::Action::PlatformSpecific( platform_specific::Action::Wayland(wayland::Action::Window(