Skip to content

Commit b70919e

Browse files
committed
x11: Assume the window was mapped after showing
Not all window managers send a MapNotify or PropertyNotify event when the window is shown, so assume that it was mapped and set the flag accordingly.
1 parent 0657ece commit b70919e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/video/x11/SDL_x11window.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,6 +1584,12 @@ void X11_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
15841584
X11_PumpEvents(_this);
15851585
data->size_move_event_flags = 0;
15861586

1587+
/* A MapNotify or PropertyNotify may not have arrived, so ensure that the shown event is dispatched
1588+
* to apply pending state before clearing the flag.
1589+
*/
1590+
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_SHOWN, 0, 0);
1591+
data->was_shown = true;
1592+
15871593
// If a configure event was received (type is non-zero), send the final window size and coordinates.
15881594
if (data->last_xconfigure.type) {
15891595
int x, y;

0 commit comments

Comments
 (0)