Skip to content

Commit 204e5aa

Browse files
fix(window-state)!: saving minimized state (#1743)
* Fix saving minimized state again * Add change file * Fix saving minimized size * Add change file * Fix missing .md * Remove window-shadows
1 parent 8a45c35 commit 204e5aa

File tree

8 files changed

+119
-106
lines changed

8 files changed

+119
-106
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"window-state": patch
3+
---
4+
5+
Fix can't restore a minimized window's size and position properly
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"window-state": patch:breaking
3+
---
4+
5+
Window's size is now stored in physical size instead of logical size

Cargo.lock

Lines changed: 18 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/api/src-tauri/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,12 @@ features = [
5353
tauri-plugin-cli = { path = "../../../plugins/cli", version = "2.0.0-rc.1" }
5454
tauri-plugin-global-shortcut = { path = "../../../plugins/global-shortcut", version = "2.0.0-rc.2" }
5555
tauri-plugin-updater = { path = "../../../plugins/updater", version = "2.0.0-rc.3" }
56+
tauri-plugin-window-state = { path = "../../../plugins/window-state", version = "2.0.0-rc.3" }
5657

5758
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
5859
tauri-plugin-barcode-scanner = { path = "../../../plugins/barcode-scanner/", version = "2.0.0-rc.4" }
5960
tauri-plugin-nfc = { path = "../../../plugins/nfc", version = "2.0.0-rc.3" }
6061
tauri-plugin-biometric = { path = "../../../plugins/biometric/", version = "2.0.0-rc.3" }
6162

62-
[target."cfg(target_os = \"windows\")".dependencies]
63-
window-shadows = "0.2"
64-
6563
[features]
6664
prod = ["tauri/custom-protocol"]

examples/api/src-tauri/gen/schemas/desktop-schema.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7502,6 +7502,55 @@
75027502
"enum": [
75037503
"updater:deny-install"
75047504
]
7505+
},
7506+
{
7507+
"description": "window-state:default -> This permission set configures what kind of\noperations are available from the window state plugin.\n\n#### Granted Permissions\n\nAll operations are enabled by default.\n\n",
7508+
"type": "string",
7509+
"enum": [
7510+
"window-state:default"
7511+
]
7512+
},
7513+
{
7514+
"description": "window-state:allow-filename -> Enables the filename command without any pre-configured scope.",
7515+
"type": "string",
7516+
"enum": [
7517+
"window-state:allow-filename"
7518+
]
7519+
},
7520+
{
7521+
"description": "window-state:allow-restore-state -> Enables the restore_state command without any pre-configured scope.",
7522+
"type": "string",
7523+
"enum": [
7524+
"window-state:allow-restore-state"
7525+
]
7526+
},
7527+
{
7528+
"description": "window-state:allow-save-window-state -> Enables the save_window_state command without any pre-configured scope.",
7529+
"type": "string",
7530+
"enum": [
7531+
"window-state:allow-save-window-state"
7532+
]
7533+
},
7534+
{
7535+
"description": "window-state:deny-filename -> Denies the filename command without any pre-configured scope.",
7536+
"type": "string",
7537+
"enum": [
7538+
"window-state:deny-filename"
7539+
]
7540+
},
7541+
{
7542+
"description": "window-state:deny-restore-state -> Denies the restore_state command without any pre-configured scope.",
7543+
"type": "string",
7544+
"enum": [
7545+
"window-state:deny-restore-state"
7546+
]
7547+
},
7548+
{
7549+
"description": "window-state:deny-save-window-state -> Denies the save_window_state command without any pre-configured scope.",
7550+
"type": "string",
7551+
"enum": [
7552+
"window-state:deny-save-window-state"
7553+
]
75057554
}
75067555
]
75077556
},

examples/api/src-tauri/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ pub fn run() {
4545
app.handle().plugin(tauri_plugin_cli::init())?;
4646
app.handle()
4747
.plugin(tauri_plugin_global_shortcut::Builder::new().build())?;
48+
app.handle()
49+
.plugin(tauri_plugin_window_state::Builder::new().build())?;
4850
app.handle()
4951
.plugin(tauri_plugin_updater::Builder::new().build())?;
5052
}
@@ -63,8 +65,7 @@ pub fn run() {
6365
.user_agent(&format!("Tauri API - {}", std::env::consts::OS))
6466
.title("Tauri API Validation")
6567
.inner_size(1000., 800.)
66-
.min_inner_size(600., 400.)
67-
.content_protected(true);
68+
.min_inner_size(600., 400.);
6869
}
6970

7071
#[cfg(target_os = "windows")]

examples/api/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
2+
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
33
"productName": "Tauri API",
44
"version": "2.0.0",
55
"identifier": "com.tauri.api",

0 commit comments

Comments
 (0)