DevelopmentNodeEnvironment_MicrosoftVSCodeDependency_22NodeVersion_Bundle_Clean_Debug_ElectronProfile_EsbuildCompiler_Mountain/IPC/WindServiceHandlers/NativeHost/IsMaximized.rs
1//! Wire method: `nativeHost:isMaximized`.
2//! Returns true if the `main` webview window is maximized. Missing window
3//! returns false (matches VS Code's behaviour on orphaned calls).
4
5use serde_json::{Value, json};
6use tauri::{AppHandle, Manager};
7
8pub async fn Fn(ApplicationHandle:AppHandle) -> Result<Value, String> {
9 let Window = ApplicationHandle.get_webview_window("main");
10
11 if let Some(W) = Window {
12 Ok(json!(W.is_maximized().unwrap_or(false)))
13 } else {
14 Ok(json!(false))
15 }
16}