mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-24 21:40:48 +02:00
fix(window-state): Ignore is_maximized state in resize events on macos (#2007)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
window-state: patch
|
||||||
|
---
|
||||||
|
|
||||||
|
On macOS the plugin now (temporarily) ignores the maximized state for undecorated windows on resize events to fix app freezes.
|
||||||
@@ -471,9 +471,18 @@ impl Builder {
|
|||||||
.0
|
.0
|
||||||
.try_lock()
|
.try_lock()
|
||||||
.is_ok()
|
.is_ok()
|
||||||
&& !window_clone.is_minimized().unwrap_or_default()
|
|
||||||
&& !window_clone.is_maximized().unwrap_or_default()
|
|
||||||
{
|
{
|
||||||
|
// TODO: Remove once https://github.com/tauri-apps/tauri/issues/5812 is resolved.
|
||||||
|
let is_maximized = if cfg!(target_os = "macos")
|
||||||
|
&& (!window_clone.is_decorated().unwrap_or_default()
|
||||||
|
|| !window_clone.is_resizable().unwrap_or_default())
|
||||||
|
{
|
||||||
|
false
|
||||||
|
} else {
|
||||||
|
window_clone.is_maximized().unwrap_or_default()
|
||||||
|
};
|
||||||
|
|
||||||
|
if !window_clone.is_minimized().unwrap_or_default() && !is_maximized {
|
||||||
let mut c = cache.lock().unwrap();
|
let mut c = cache.lock().unwrap();
|
||||||
if let Some(state) = c.get_mut(&label) {
|
if let Some(state) = c.get_mut(&label) {
|
||||||
state.width = size.width;
|
state.width = size.width;
|
||||||
@@ -481,6 +490,7 @@ impl Builder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user