mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-25 14:51:30 +11:00
Fix deadlock wayland. (#1438)
This commit is contained in:
parent
2f8aa5c52a
commit
c1eb7f9629
|
@ -481,9 +481,10 @@ impl WindowStore {
|
||||||
for window in &mut self.windows {
|
for window in &mut self.windows {
|
||||||
let opt_arc = window.frame.upgrade();
|
let opt_arc = window.frame.upgrade();
|
||||||
let mut opt_mutex_lock = opt_arc.as_ref().map(|m| m.lock().unwrap());
|
let mut opt_mutex_lock = opt_arc.as_ref().map(|m| m.lock().unwrap());
|
||||||
|
let mut size = { *window.size.lock().unwrap() };
|
||||||
f(WindowStoreForEach {
|
f(WindowStoreForEach {
|
||||||
newsize: window.newsize.take(),
|
newsize: window.newsize.take(),
|
||||||
size: &mut *(window.size.lock().unwrap()),
|
size: &mut size,
|
||||||
prev_dpi: window.current_dpi,
|
prev_dpi: window.current_dpi,
|
||||||
new_dpi: window.new_dpi,
|
new_dpi: window.new_dpi,
|
||||||
closed: window.closed,
|
closed: window.closed,
|
||||||
|
@ -492,6 +493,7 @@ impl WindowStore {
|
||||||
wid: make_wid(&window.surface),
|
wid: make_wid(&window.surface),
|
||||||
frame: opt_mutex_lock.as_mut().map(|m| &mut **m),
|
frame: opt_mutex_lock.as_mut().map(|m| &mut **m),
|
||||||
});
|
});
|
||||||
|
*window.size.lock().unwrap() = size;
|
||||||
if let Some(dpi) = window.new_dpi.take() {
|
if let Some(dpi) = window.new_dpi.take() {
|
||||||
window.current_dpi = dpi;
|
window.current_dpi = dpi;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue