Skip to content

Commit

Permalink
wayland: Send exposure events when showing or resizing the window
Browse files Browse the repository at this point in the history
Clients may rely on this event to signal when they should redraw themselves, so send it when appropriate.
  • Loading branch information
Kontrabant committed Sep 10, 2024
1 parent 5b57573 commit 3f497c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/video/wayland/SDL_waylandwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,9 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window)
* HideWindow was called immediately before ShowWindow.
*/
WAYLAND_wl_display_roundtrip(c->display);

/* Send an exposure event to signal that the client should draw. */
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_EXPOSED, 0, 0);
}

static void Wayland_ReleasePopup(_THIS, SDL_Window *popup)
Expand Down Expand Up @@ -2094,6 +2097,7 @@ static void Wayland_HandleResize(SDL_Window *window, int width, int height, floa
window->w = 0;
window->h = 0;
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, width, height);
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_EXPOSED, 0, 0);
window->w = width;
window->h = height;
data->needs_resize_event = SDL_FALSE;
Expand Down

0 comments on commit 3f497c6

Please sign in to comment.