From f0a1bbcf7c4c06208e80c84607b399d9e94c93ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aliaksandr=20Tru=C5=A1?= Date: Sun, 4 Aug 2024 13:26:58 +0200 Subject: [PATCH] feat: implement toggle_fullscreen for Wayland --- window/src/os/wayland/window.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/window/src/os/wayland/window.rs b/window/src/os/wayland/window.rs index 254f42dea78..663dfe94e86 100644 --- a/window/src/os/wayland/window.rs +++ b/window/src/os/wayland/window.rs @@ -452,6 +452,17 @@ impl WindowOps for WaylandWindow { Ok(()) }); } + + fn toggle_fullscreen(&self) { + WaylandConnection::with_window_inner(self.0, move |inner| { + if inner.window_state.contains(WindowState::FULL_SCREEN) { + inner.window.as_ref().unwrap().unset_fullscreen(); + } else { + inner.window.as_ref().unwrap().set_fullscreen(None); + } + Ok(()) + }); + } } #[derive(Default, Clone, Debug)] pub(crate) struct PendingEvent {