Fix sending SDL_WINDOWEVENT_RESTORED after unminimizing windows on X11

SDL_SendWindowEvent will only send a RESTORED event if the window has
the minimized or maximized flag set. However, for a SHOWN event, it
will clear the minimized flag. Since the SHOWN event was being sent
first for a MapNotify event, the RESTORED event would never be sent.
Swapping the SendWindowEvent calls around fixes this.

https://bugzilla.libsdl.org/show_bug.cgi?id=4821
This commit is contained in:
Alex Smith 2019-12-02 15:41:25 +00:00
parent 55eb76218d
commit e5af951eae
1 changed files with 1 additions and 1 deletions

View File

@ -433,8 +433,8 @@ X11_DispatchFocusOut(_THIS, SDL_WindowData *data)
static void static void
X11_DispatchMapNotify(SDL_WindowData *data) X11_DispatchMapNotify(SDL_WindowData *data)
{ {
SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0); SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0);
SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
} }
static void static void