Skip to content

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

Merged
prokopyl merged 1 commit into
RustAudio:masterfrom
AlexCharlton:win-resized-on-system-scale-factor
May 25, 2026
Merged

Windows: Ensure WindowEvent::Resized is sent when opening a SystemScaleFactor window (bugfix)#254
prokopyl merged 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
@prokopyl prokopyl force-pushed the win-resized-on-system-scale-factor branch from e3bc805 to 165e2c5 Compare May 25, 2026 21:57
@prokopyl prokopyl self-assigned this May 25, 2026
@prokopyl prokopyl force-pushed the win-resized-on-system-scale-factor branch from 165e2c5 to 790017b Compare May 25, 2026 22:30
@prokopyl prokopyl merged commit 017242f into RustAudio:master May 25, 2026
7 checks passed
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