video: Send the new fullscreen size in screen coordinates
After successfully entering fullscreen, send the new fullscreen window dimensions in screen coordinates, not pixels, to avoid a unit mismatch.
This commit is contained in:
parent
c2d79cb411
commit
fc5f363ff7
|
@ -1499,11 +1499,13 @@ static int SDL_UpdateFullscreenMode(SDL_Window *window, SDL_bool fullscreen)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* This is also unnecessary on Win32 (WIN_SetWindowFullscreen calls SetWindowPos,
|
/* This is also unnecessary on Win32 (WIN_SetWindowFullscreen calls SetWindowPos,
|
||||||
* WM_WINDOWPOSCHANGED will send SDL_EVENT_WINDOW_RESIZED). Also, on Windows with DPI scaling enabled,
|
* WM_WINDOWPOSCHANGED will send SDL_EVENT_WINDOW_RESIZED).
|
||||||
* we're keeping modes in pixels, but window sizes in dpi-scaled points, so this would be a unit mismatch.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* The new fullscreen window size must be sent in screen coordinates, not pixels. */
|
||||||
SDL_SendWindowEvent(other, SDL_EVENT_WINDOW_RESIZED,
|
SDL_SendWindowEvent(other, SDL_EVENT_WINDOW_RESIZED,
|
||||||
fullscreen_mode.w, fullscreen_mode.h);
|
(int)(fullscreen_mode.w / fullscreen_mode.display_scale),
|
||||||
|
(int)(fullscreen_mode.h / fullscreen_mode.display_scale));
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
SDL_OnWindowResized(other);
|
SDL_OnWindowResized(other);
|
||||||
|
|
Loading…
Reference in a new issue