Skip to content

Commit 4dfae61

Browse files
authored
Maximize desktop window on launch (#925)
1 parent ae430d4 commit 4dfae61

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

desktop/src-tauri/src/lib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,17 @@ pub fn run() {
383383
.plugin(tauri_plugin_opener::init())
384384
.plugin(
385385
tauri_plugin_window_state::Builder::default()
386-
.with_state_flags(StateFlags::all() & !StateFlags::VISIBLE)
386+
// The main window should always launch edge-to-edge in the
387+
// available desktop area. Do not let stale saved geometry or
388+
// fullscreen state override the maximized launch config.
389+
.with_state_flags(
390+
StateFlags::all()
391+
& !(StateFlags::VISIBLE
392+
| StateFlags::POSITION
393+
| StateFlags::SIZE
394+
| StateFlags::MAXIMIZED
395+
| StateFlags::FULLSCREEN),
396+
)
387397
.build(),
388398
)
389399
.plugin(tauri_plugin_websocket::init())

desktop/src-tauri/tauri.conf.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"title": "",
2020
"width": 800,
2121
"height": 600,
22+
"maximized": true,
2223
"visible": false,
2324
"titleBarStyle": "Overlay",
2425
"hiddenTitle": true,

0 commit comments

Comments
 (0)