Use SDL_WINDOWEVENT_DISPLAY_CHANGED
to notice about window switching display to update _density
an dpi
#7982
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Maintainer merge checklist
Component: xxx
label.api-deprecation
orapi-break
label.release-highlight
label to be highlighted in release notes.versionadded
,versionchanged
as needed.🔴 It was supposed to be "Ready to Merge", but the CI is failing. We should consider how the SDL2 dep is managed on Ubuntu and other Linux distros.
SDL_WINDOWEVENT_DISPLAY_CHANGED
has been added on SDL2.0.18
but needs SDL2.24.0
to work as expected on macOS, as previously was using a non-macOS compatible logic to compute the display on which the window is really attached to (#7974 bumps SDL2 to2.24.0
).💡 Since now
SDL2
seems to be aware ofDPI
on all platforms (including Windows), we may want to update howdpi
gets computed.SDL_WINDOWEVENT_*
declarations for future usage.SDL_WINDOWEVENT_DISPLAY_CHANGED
so we can notice about a window that changed the display is attached to._update_density_and_dpi
which updates_density
anddpi
to avoid DRY violationsPreviously:
After: