Skip to content

Commit

Permalink
Fix resizing on Windows not triggering an event
Browse files Browse the repository at this point in the history
Resizing should trigger a baseview resize event, but because we already
set the new size here the `WM_SIZE` event was ignored.
  • Loading branch information
robbert-vdh committed Dec 30, 2023
1 parent 2c1b1a7 commit 1d25b15
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/win/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,17 +482,14 @@ impl WindowState {
self.handler.borrow_mut()
}

/// Handle a deferred task as described in [`Self::deferred_tasks
/// Handle a deferred task as described in [`Self::deferred_tasks`].
pub(self) fn handle_deferred_task(&self, task: WindowTask) {
match task {
WindowTask::Resize(size) => {
let window_info = {
let mut window_info = self.window_info.borrow_mut();
let scaling = window_info.scale();
*window_info = WindowInfo::from_logical_size(size, scaling);

*window_info
};
// `self.window_info` will be modified in response to the `WM_SIZE` event that
// follows the `SetWindowPos()` call
let scaling = self.window_info.borrow().scale();
let window_info = WindowInfo::from_logical_size(size, scaling);

// If the window is a standalone window then the size needs to include the window
// decorations
Expand Down

0 comments on commit 1d25b15

Please sign in to comment.