Browse Source

wayland: Destroy the seats before stopping the cursor surface event thread

Stopping the thread also destroys the queue used by pointer surfaces, and if any seats still have a surface associated with the queue at that time, it will cause a libwayland warning. Destroying the seats first ensures that all surfaces associated with the thread queue are destroyed before the queue is destroyed.
Frank Praznik 1 tháng trước cách đây
mục cha
commit
acaf53926c
1 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 3 4
      src/video/wayland/SDL_waylandvideo.c

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

@@ -1512,11 +1512,8 @@ static void Wayland_VideoCleanup(SDL_VideoDevice *_this)
 {
     SDL_VideoData *data = _this->internal;
     SDL_WaylandSeat *seat, *tmp;
-    int i;
-
-    Wayland_FiniMouse(data);
 
-    for (i = _this->num_displays - 1; i >= 0; --i) {
+    for (int i = _this->num_displays - 1; i >= 0; --i) {
         SDL_VideoDisplay *display = _this->displays[i];
         Wayland_free_display(display, false);
     }
@@ -1526,6 +1523,8 @@ static void Wayland_VideoCleanup(SDL_VideoDevice *_this)
         Wayland_SeatDestroy(seat, false);
     }
 
+    Wayland_FiniMouse(data);
+
     if (data->pointer_constraints) {
         zwp_pointer_constraints_v1_destroy(data->pointer_constraints);
         data->pointer_constraints = NULL;