diff --git a/app/tauri/src/commands.rs b/app/tauri/src/commands.rs index 97cd6f02..78f423e1 100644 --- a/app/tauri/src/commands.rs +++ b/app/tauri/src/commands.rs @@ -30,15 +30,28 @@ fn set_show(_window: tauri::Window) { #[tauri::command] fn set_always_on_top(always_on_top: bool, window: tauri::Window) { println!("set_always_on_top! {}", always_on_top); - match window.set_always_on_top(always_on_top) { - Ok(_) => (), - Err(e) => println!("There was a problem altering always on top: {}", e), - } + try_set_always_on_top(always_on_top, &window); } #[tauri::command] -fn set_fullscreen_break(should_fullscreen: bool, always_on_top: bool, _window: tauri::Window) { +fn set_fullscreen_break(should_fullscreen: bool, always_on_top: bool, window: tauri::Window) { println!("set_fullscreen_break! {} {}", should_fullscreen, always_on_top); + try_set_always_on_top(always_on_top, &window); + try_set_fullscreen(should_fullscreen, &window); +} + +fn try_set_fullscreen(fullscreen: bool, window: &tauri::Window) { + match window.set_fullscreen(fullscreen) { + Ok(_) => (), + Err(e) => println!("There was a problem setting fullscreen: {}", e), + } +} + +fn try_set_always_on_top(always_on_top: bool, window: &tauri::Window) { + match window.set_always_on_top(always_on_top) { + Ok(_) => (), + Err(e) => println!("There was a problem altering always on top: {}", e), + } } fn try_set_min_size(size: Option>, window: &tauri::Window) {