Skip to content

Commit 776d11a

Browse files
committed
wayland: Remove unnecessary flushes
Events are implicitly flushed during blocking dispatches and round-trips. Remove some unnecessary uses of wl_display_flush().
1 parent bfa89b3 commit 776d11a

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

src/video/wayland/SDL_waylandevents.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3654,8 +3654,6 @@ void Wayland_DisplayCreateSeat(SDL_VideoData *display, struct wl_seat *wl_seat,
36543654
if (display->tablet_manager) {
36553655
Wayland_SeatInitTabletSupport(seat);
36563656
}
3657-
3658-
WAYLAND_wl_display_flush(display->display);
36593657
}
36603658

36613659
void Wayland_DisplayRemoveWindowReferencesFromSeats(SDL_VideoData *display, SDL_WindowData *window)

src/video/wayland/SDL_waylandvideo.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ static void Wayland_DeleteDevice(SDL_VideoDevice *device)
461461
{
462462
SDL_VideoData *data = device->internal;
463463
if (data->display && !data->display_externally_owned) {
464-
WAYLAND_wl_display_flush(data->display);
465464
WAYLAND_wl_display_disconnect(data->display);
466465
SDL_ClearProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER);
467466
}
@@ -1454,9 +1453,6 @@ bool Wayland_VideoInit(SDL_VideoDevice *_this)
14541453
Wayland_FinalizeDisplays(data);
14551454

14561455
Wayland_InitMouse();
1457-
1458-
WAYLAND_wl_display_flush(data->display);
1459-
14601456
Wayland_InitKeyboard(_this);
14611457

14621458
if (data->primary_selection_device_manager) {

src/video/wayland/SDL_waylandwindow.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,8 +2027,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
20272027
if (data->shell_surface_type == WAYLAND_SHELL_SURFACE_TYPE_LIBDECOR) {
20282028
if (data->shell_surface.libdecor.frame) {
20292029
while (data->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_CONFIGURE) {
2030-
WAYLAND_wl_display_flush(c->display);
2031-
WAYLAND_wl_display_dispatch(c->display);
2030+
libdecor_dispatch(c->shell.libdecor, -1);
20322031
}
20332032
}
20342033
} else
@@ -2041,7 +2040,6 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
20412040
wl_surface_commit(data->surface);
20422041
if (data->shell_surface.xdg.surface) {
20432042
while (data->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_CONFIGURE) {
2044-
WAYLAND_wl_display_flush(c->display);
20452043
WAYLAND_wl_display_dispatch(c->display);
20462044
}
20472045
}
@@ -3266,7 +3264,6 @@ void Wayland_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
32663264
wind->icon_buffer_count = 0;
32673265

32683266
SDL_free(wind);
3269-
WAYLAND_wl_display_flush(data->display);
32703267
}
32713268
window->internal = NULL;
32723269
}

0 commit comments

Comments
 (0)