Skip to content

window-state still flickers on the startup #3362

@1111mp

Description

@1111mp

Describe the bug

Already referenced: #2042

On the macOS platform, when using window-state, the app still flickers on every startup due to restoring the previous window position. (This does not occur in the development environment, but happens after packaging and installing the app.) The flickering is especially noticeable in a multi-monitor setup.

yyyyyy.mov

Reproduction

Just create an empty project using pnpm create tauri-app, then install and integrate tauri-plugin-window-state.

tauri.conf.json:

"windows": [
      {
        "title": "tauri-app",
        "width": 800,
        "height": 600,
        "visible": false // aleady had set false
      }
    ],

lib.rs:

// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
#[tauri::command]
fn greet(name: &str) -> String {
    format!("Hello, {}! You've been greeted from Rust!", name)
}

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
    tauri::Builder::default()
        .plugin(tauri_plugin_window_state::Builder::default().build())
        .plugin(tauri_plugin_opener::init())
        .invoke_handler(tauri::generate_handler![greet])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Expected behavior

If the window is shown only after the window state has been applied and taken effect, the flickering does not occur.

Full tauri info output

[✔] Environment
    - OS: Mac OS 26.4.0 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ Xcode: 26.3
    ✔ rustc: 1.94.0 (4a4ef493e 2026-03-02)
    ✔ cargo: 1.94.0 (85eff7c80 2026-01-15)
    ✔ rustup: 1.29.0 (28d1352db 2026-03-05)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 24.13.0
    - pnpm: 10.33.0
    - yarn: 1.22.22
    - npm: 11.6.2

[-] Packages
    - tauri 🦀: 2.10.3
    - tauri-build 🦀: 2.5.6
    - wry 🦀: 0.54.4, (outdated, latest: 0.55.0)
    - tao 🦀: 0.34.8, (outdated, latest: 0.35.0)
    - @tauri-apps/api  ⱼₛ: 2.10.1
    - @tauri-apps/cli  ⱼₛ: 2.10.1

[-] Plugins
    - tauri-plugin-opener 🦀: 2.5.3
    - @tauri-apps/plugin-opener  ⱼₛ: 2.5.3
    - tauri-plugin-window-state 🦀: 2.4.1
    - @tauri-apps/plugin-window-state  ⱼₛ: not installed!

I upgraded Tauri and all related dependencies to the latest versions, but the issue still persists.

My device information:

Device: MacBook Pro (M1 Max)
Chip: Apple M1 Max
OS Version: macOS Tahoe 26.4

Stack trace


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions