Fix sending SDL_WINDOWEVENT_RESTORED after unminimizing windows on X11
authorAlex Smith <asmith@feralinteractive.com>
Mon, 02 Dec 2019 15:41:25 +0000
changeset 1331181ca537d1287
parent 13310 f9a9707ff56d
child 13312 dde034962e3a
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
src/video/x11/SDL_x11events.c
     1.1 --- a/src/video/x11/SDL_x11events.c	Wed Nov 20 20:27:45 2019 -0800
     1.2 +++ b/src/video/x11/SDL_x11events.c	Mon Dec 02 15:41:25 2019 +0000
     1.3 @@ -433,8 +433,8 @@
     1.4  static void
     1.5  X11_DispatchMapNotify(SDL_WindowData *data)
     1.6  {
     1.7 +    SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0);
     1.8      SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
     1.9 -    SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_RESTORED, 0, 0);
    1.10  }
    1.11  
    1.12  static void