Skip to content

Commit 9cec0eb

Browse files
authored
Extend #837 for resizing (#865)
1 parent 7404659 commit 9cec0eb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

druid-shell/src/platform/gtk/window.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,12 @@ impl WindowBuilder {
252252
);
253253

254254
if last_size.get() != size {
255-
last_size.set(size);
256-
state.handler.borrow_mut().size(size.0, size.1);
255+
if let Ok(mut handler_borrow) = state.handler.try_borrow_mut() {
256+
last_size.set(size);
257+
handler_borrow.size(size.0, size.1);
258+
} else {
259+
log::warn!("Resizing was skipped because the handler was already borrowed");
260+
}
257261
}
258262

259263
// For some reason piet needs a mutable context, so give it one I guess.

0 commit comments

Comments
 (0)