From 30867df46c3896c87c99f93ffe5dd105fafa3e52 Mon Sep 17 00:00:00 2001 From: Janis Date: Sun, 8 May 2022 02:53:31 +0200 Subject: [PATCH] added update_window_type function to clients which updates floating for dialog style windows --- src/clients.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/clients.rs b/src/clients.rs index 567e350..d44221b 100644 --- a/src/clients.rs +++ b/src/clients.rs @@ -606,6 +606,20 @@ impl ClientState { } } + pub fn update_window_type(&mut self, key: &K, window_type: WindowType) + where + K: ClientKey, + { + if let Some(client) = self.get_mut(key).into_option() { + client.window_type = window_type; + + match window_type { + WindowType::Normal => self.set_floating(key), + _ => self.set_tiled(key), + }; + } + } + fn remove_from_virtual_screens(&mut self, key: &K) where K: ClientKey,