Skip to content

Commit 5075c81

Browse files
fix: check is_maximizable in internal_toggle_maximize (#15550)
1 parent 532c22a commit 5075c81

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch:bug
3+
---
4+
5+
Fix double clicking `data-tauri-drag-region` maximizes the window even when `is_maximizable` is set to false

.changes/fix-ndk-home-not-honor.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
"tauri": patch:bug
2+
"tauri-cli": "patch:bug"
3+
"@tauri-apps/cli": "patch:bug"
34
---
45

56
Fix NDK_HOME environment variable not honored when set

crates/tauri/src/window/plugin.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,10 @@ mod desktop_commands {
208208
label: Option<String>,
209209
) -> crate::Result<()> {
210210
let window = get_window(window, label)?;
211-
match window.is_maximized()? {
212-
true => window.unmaximize()?,
213-
false => window.maximize()?,
211+
if window.is_maximized()? {
212+
window.unmaximize()?
213+
} else {
214+
window.maximize()?
214215
};
215216
Ok(())
216217
}
@@ -222,9 +223,10 @@ mod desktop_commands {
222223
) -> crate::Result<()> {
223224
let window = get_window(window, label)?;
224225
if window.is_resizable()? {
225-
match window.is_maximized()? {
226-
true => window.unmaximize()?,
227-
false => window.maximize()?,
226+
if window.is_maximized()? {
227+
window.unmaximize()?
228+
} else if window.is_maximizable()? {
229+
window.maximize()?
228230
};
229231
}
230232
Ok(())

0 commit comments

Comments
 (0)