fix(windows): center the main window on startup (#1664)

This commit is contained in:
ppxb authored and GitHub committed 2026-11-07 01:59:33 +08:00
1 parent 7a6b1601d5
commit b1171ecd23
2 files changed
+11 -1

No files matched your search

+10 -1
View File
@@ -252,7 +252,16 @@ pub fn run() {
#[cfg(not(target_os = "linux"))]
fn window_state_flags() -> tauri_plugin_window_state::StateFlags {
use tauri_plugin_window_state::StateFlags;
StateFlags::SIZE | StateFlags::POSITION | StateFlags::MAXIMIZED | StateFlags::FULLSCREEN
#[cfg(target_os = "windows")]
{
// Start at the configured size, centered, instead of restoring geometry after the
// window is visible (Windows briefly showed the default position before that move).
StateFlags::MAXIMIZED | StateFlags::FULLSCREEN
}
#[cfg(not(target_os = "windows"))]
{
StateFlags::SIZE | StateFlags::POSITION | StateFlags::MAXIMIZED | StateFlags::FULLSCREEN
}
}
/// Routes IDE menu items to the focused window's frontend (`executeAction`).
+1
View File
@@ -7,6 +7,7 @@
"title": "OpenIDEA",
"width": 1440,
"height": 900,
"center": true,
"minWidth": 800,
"minHeight": 500,
"decorations": false,