Skip to content

Commit

Permalink
Extend #837 for resizing (#865)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-uk1 authored Apr 22, 2020
1 parent 7404659 commit 9cec0eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions druid-shell/src/platform/gtk/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,12 @@ impl WindowBuilder {
);

if last_size.get() != size {
last_size.set(size);
state.handler.borrow_mut().size(size.0, size.1);
if let Ok(mut handler_borrow) = state.handler.try_borrow_mut() {
last_size.set(size);
handler_borrow.size(size.0, size.1);
} else {
log::warn!("Resizing was skipped because the handler was already borrowed");
}
}

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

0 comments on commit 9cec0eb

Please # to comment.