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