video: Synthesize fullscreen related moves if the driver does not.

(cherry picked from commit 9f9a442823)
This commit is contained in:
Frank Praznik
2025-03-04 12:17:12 -05:00
parent 26d1afa29c
commit ac09af2600

View File

@@ -1984,18 +1984,24 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
* This is also unnecessary on Cocoa, Wayland, Win32, and X11 (will send SDL_EVENT_WINDOW_RESIZED).
*/
if (!SDL_SendsFullscreenDimensions(_this)) {
SDL_Rect displayRect;
if (mode) {
mode_w = mode->w;
mode_h = mode->h;
SDL_GetDisplayBounds(mode->displayID, &displayRect);
} else {
mode_w = display->desktop_mode.w;
mode_h = display->desktop_mode.h;
SDL_GetDisplayBounds(display->id, &displayRect);
}
if (window->w != mode_w || window->h != mode_h) {
resized = true;
}
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_MOVED, displayRect.x, displayRect.y);
if (resized) {
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, mode_w, mode_h);
} else {
@@ -2044,6 +2050,7 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b
}
if (!SDL_SendsFullscreenDimensions(_this)) {
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_MOVED, window->windowed.x, window->windowed.y);
if (resized) {
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window->windowed.w, window->windowed.h);
} else {