Skip to content

Windows: Ensure WindowEvent::Resized is sent when opening a SystemScaleFactor window (bugfix)#254

Open
AlexCharlton wants to merge 1 commit into
RustAudio:masterfrom
AlexCharlton:win-resized-on-system-scale-factor
Open

Windows: Ensure WindowEvent::Resized is sent when opening a SystemScaleFactor window (bugfix)#254
AlexCharlton wants to merge 1 commit into
RustAudio:masterfrom
AlexCharlton:win-resized-on-system-scale-factor

Conversation

@AlexCharlton
Copy link
Copy Markdown
Contributor

Windows forces you to open a window before you can get the screen's scale factor. This means that when we call the build callback, we don't actually know the scale factor. Only after calling build do we resize the window to the correct size. baseview users need to know how big their windows are though, but because they can't get the right size at build, they rely on getting a WindowEvent::Resized event after the window has opened.

This of course means that a WindowEvent::Resized needs to actually be sent. We were relying on a call to SetWindowPos (the one doing the window resizing after we get the scale factor) to passively trigger the event, but this wasn't actually getting delivered to the handler. This PR explicitly sends Resized to the WindowHandler::on_event instead.

@prokopyl prokopyl added this to the v0.1.2 - Safer internals milestone May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants