Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[window-state] Window titlebar disappears when calling restore_state() before save_window_state() #421

Closed
takashikawanaka opened this issue Jun 7, 2023 · 0 comments

Comments

@takashikawanaka
Copy link

Prerequisite

Change the tauri.bundle.identifier in tauri.conf.json to avoid loading another .window-state.

What I did

  • yarn create tauri-app
  • Add tauri-plugin-window-state
  • Add Rust Code

main.rs

// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

use tauri::App;
use tauri::Manager;
use tauri_plugin_window_state::{AppHandleExt, StateFlags, WindowExt};

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

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_window_state::Builder::default().build())
        .setup(|app: &mut App| {
            let window = app.get_window("main").unwrap();
            let result = window.restore_state(StateFlags::all());
            if let Err(e) = result {
                eprintln!("{}", e);
            }
            let result = app.handle().save_window_state(StateFlags::default());
            if let Err(e) = result {
                eprintln!("{}", e);
            }
            Ok(())
        })
        .invoke_handler(tauri::generate_handler![greet])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

スクリーンショット 2023-06-07 170149

amrbashir added a commit that referenced this issue Jun 13, 2023
* fix(window-state): manual default implentation, closes #421

* Update lib.rs
amrbashir added a commit that referenced this issue Jun 13, 2023
* fix(window-state): manual default implentation, closes #421

* Update lib.rs
amrbashir added a commit that referenced this issue Jun 13, 2023
* fix(window-state): correctly set decoration state if no saved state exists, fixes #421 (#424)

* fix(window-state): propagate promise (#435)

closes #432

* fix(window-state): manual default implentation (#425)

* fix(window-state): manual default implentation, closes #421

* Update lib.rs

* change file

* generated files

* fix symlinks?

---------

Co-authored-by: Fabian-Lars <[email protected]>
OrIOg pushed a commit to OrIOg/plugins-workspace that referenced this issue Jun 25, 2023
OrIOg pushed a commit to OrIOg/plugins-workspace that referenced this issue Jun 25, 2023
* fix(window-state): manual default implentation, closes tauri-apps#421

* Update lib.rs
lucasfernog added a commit that referenced this issue Jul 19, 2023
Co-authored-by: Fabian-Lars <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <[email protected]>
Co-authored-by: FabianLars <[email protected]>
Co-authored-by: Alexandre Dang <[email protected]>
Co-authored-by: Ludea <[email protected]>
Co-authored-by: Amr Bashir <[email protected]>
Co-authored-by: Duke Jones <[email protected]>
Co-authored-by: NaokiM03 <[email protected]>
Co-authored-by: Thibault <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: David Blythe <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
fix(stronghold): change wrong argument name for `remove` (#422)
fix(window-state): correctly set decoration state if no saved state exists, fixes #421 (#424)
fix(stronghold): return null if there is no record (#129)
fix(window-state): propagate promise (#435)
closes #432
fix(window-state): manual default implentation (#425)
fix(window-state): manual default implentation, closes #421
fix(deps): update rust crate iota-crypto to 0.21 (#438)
fix readme example (#447)
fix: handle recursive directory correctly (#455)
fix(deps): update rust crate sqlx to 0.7. plugin-sql msrv is now 1.65 (#464)
fix(persisted-scope): separately save asset protocol patterns (#459)
fix(deps): update rust crate iota-crypto to 0.22 (#475)
fix(deps): update tauri monorepo to v1.4.0 (#482)
resolve to v15.1.0 (#489)
fix(deps): update rust crate iota-crypto to 0.23 (#495)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant