Skip to content

Commit

Permalink
Fix sending SDL_WINDOWEVENT_RESTORED after unminimizing windows on X11
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Alex Smith committed Dec 2, 2019
1 parent 55eb762 commit e5af951
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11events.c
Expand Up @@ -433,8 +433,8 @@ X11_DispatchFocusOut(_THIS, SDL_WindowData *data)
static void
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_SHOWN, 0, 0);
}

static void
Expand Down

0 comments on commit e5af951

Please sign in to comment.