1
0
Fork 0

Fix resizing on Windows not triggering an event (#166)

Resizing should trigger a baseview resize event, but because we already
set the new size here the `WM_SIZE` event was ignored.

Co-authored-by: Micah Johnston <micah@photophore.systems>
This commit is contained in:
Robbert van der Helm 2024-03-26 17:05:24 +01:00 committed by GitHub
parent 65d970495f
commit ea0cd5367d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -509,17 +509,14 @@ impl WindowState {
self.handler.borrow_mut() 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) { pub(self) fn handle_deferred_task(&self, task: WindowTask) {
match task { match task {
WindowTask::Resize(size) => { WindowTask::Resize(size) => {
let window_info = { // `self.window_info` will be modified in response to the `WM_SIZE` event that
let mut window_info = self.window_info.borrow_mut(); // follows the `SetWindowPos()` call
let scaling = window_info.scale(); let scaling = self.window_info.borrow().scale();
*window_info = WindowInfo::from_logical_size(size, scaling); let window_info = WindowInfo::from_logical_size(size, scaling);
*window_info
};
// If the window is a standalone window then the size needs to include the window // If the window is a standalone window then the size needs to include the window
// decorations // decorations