Skip to main content

Mountain/IPC/WindServiceHandlers/NativeHost/
IsFullscreen.rs

1#![allow(non_snake_case, unused_variables, dead_code, unused_imports)]
2
3//! Wire method: `nativeHost:isFullscreen`.
4//! Returns true if the `main` webview window is fullscreen. Missing window
5//! returns false - this is a read-only probe and should not error.
6
7use serde_json::{Value, json};
8use tauri::{AppHandle, Manager};
9
10pub async fn NativeIsFullscreen(ApplicationHandle:AppHandle) -> Result<Value, String> {
11	let Window = ApplicationHandle.get_webview_window("main");
12	if let Some(W) = Window {
13		Ok(json!(W.is_fullscreen().unwrap_or(false)))
14	} else {
15		Ok(json!(false))
16	}
17}