瀏覽代碼

wayland: Remove unnecessary flushes

Events are implicitly flushed during blocking dispatches and round-trips. Remove some unnecessary uses of wl_display_flush().
Frank Praznik 4 月之前
父節點
當前提交
776d11a9c8

+ 0 - 2
src/video/wayland/SDL_waylandevents.c

@@ -3654,8 +3654,6 @@ void Wayland_DisplayCreateSeat(SDL_VideoData *display, struct wl_seat *wl_seat,
     if (display->tablet_manager) {
     if (display->tablet_manager) {
         Wayland_SeatInitTabletSupport(seat);
         Wayland_SeatInitTabletSupport(seat);
     }
     }
-
-    WAYLAND_wl_display_flush(display->display);
 }
 }
 
 
 void Wayland_DisplayRemoveWindowReferencesFromSeats(SDL_VideoData *display, SDL_WindowData *window)
 void Wayland_DisplayRemoveWindowReferencesFromSeats(SDL_VideoData *display, SDL_WindowData *window)

+ 0 - 4
src/video/wayland/SDL_waylandvideo.c

@@ -461,7 +461,6 @@ static void Wayland_DeleteDevice(SDL_VideoDevice *device)
 {
 {
     SDL_VideoData *data = device->internal;
     SDL_VideoData *data = device->internal;
     if (data->display && !data->display_externally_owned) {
     if (data->display && !data->display_externally_owned) {
-        WAYLAND_wl_display_flush(data->display);
         WAYLAND_wl_display_disconnect(data->display);
         WAYLAND_wl_display_disconnect(data->display);
         SDL_ClearProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER);
         SDL_ClearProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER);
     }
     }
@@ -1454,9 +1453,6 @@ bool Wayland_VideoInit(SDL_VideoDevice *_this)
     Wayland_FinalizeDisplays(data);
     Wayland_FinalizeDisplays(data);
 
 
     Wayland_InitMouse();
     Wayland_InitMouse();
-
-    WAYLAND_wl_display_flush(data->display);
-
     Wayland_InitKeyboard(_this);
     Wayland_InitKeyboard(_this);
 
 
     if (data->primary_selection_device_manager) {
     if (data->primary_selection_device_manager) {

+ 1 - 4
src/video/wayland/SDL_waylandwindow.c

@@ -2027,8 +2027,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
     if (data->shell_surface_type == WAYLAND_SHELL_SURFACE_TYPE_LIBDECOR) {
     if (data->shell_surface_type == WAYLAND_SHELL_SURFACE_TYPE_LIBDECOR) {
         if (data->shell_surface.libdecor.frame) {
         if (data->shell_surface.libdecor.frame) {
             while (data->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_CONFIGURE) {
             while (data->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_CONFIGURE) {
-                WAYLAND_wl_display_flush(c->display);
-                WAYLAND_wl_display_dispatch(c->display);
+                libdecor_dispatch(c->shell.libdecor, -1);
             }
             }
         }
         }
     } else
     } else
@@ -2041,7 +2040,6 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
         wl_surface_commit(data->surface);
         wl_surface_commit(data->surface);
         if (data->shell_surface.xdg.surface) {
         if (data->shell_surface.xdg.surface) {
             while (data->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_CONFIGURE) {
             while (data->shell_surface_status == WAYLAND_SHELL_SURFACE_STATUS_WAITING_FOR_CONFIGURE) {
-                WAYLAND_wl_display_flush(c->display);
                 WAYLAND_wl_display_dispatch(c->display);
                 WAYLAND_wl_display_dispatch(c->display);
             }
             }
         }
         }
@@ -3266,7 +3264,6 @@ void Wayland_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
         wind->icon_buffer_count = 0;
         wind->icon_buffer_count = 0;
 
 
         SDL_free(wind);
         SDL_free(wind);
-        WAYLAND_wl_display_flush(data->display);
     }
     }
     window->internal = NULL;
     window->internal = NULL;
 }
 }