x11: Send a restored event before entering fullscreen

Ensures that the maximized flag is cleared on fullscreen windows.
This commit is contained in:
Frank Praznik 2025-04-03 17:02:17 -04:00
parent 667b706a93
commit ca613b9d8f
No known key found for this signature in database
1 changed files with 2 additions and 0 deletions

View File

@ -1813,6 +1813,8 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent)
if (!(flags & SDL_WINDOW_MINIMIZED)) {
const bool commit = SDL_memcmp(&data->window->current_fullscreen_mode, &data->requested_fullscreen_mode, sizeof(SDL_DisplayMode)) != 0;
// Ensure the maximized flag is cleared before entering fullscreen.
SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_RESTORED, 0, 0);
SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_ENTER_FULLSCREEN, 0, 0);
if (commit) {
/* This was initiated by the compositor, or the mode was changed between the request and the window