Skip to content

Commit acaf539

Browse files
committed
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.
1 parent 38df1c3 commit acaf539

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/video/wayland/SDL_waylandvideo.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,11 +1512,8 @@ static void Wayland_VideoCleanup(SDL_VideoDevice *_this)
15121512
{
15131513
SDL_VideoData *data = _this->internal;
15141514
SDL_WaylandSeat *seat, *tmp;
1515-
int i;
1516-
1517-
Wayland_FiniMouse(data);
15181515

1519-
for (i = _this->num_displays - 1; i >= 0; --i) {
1516+
for (int i = _this->num_displays - 1; i >= 0; --i) {
15201517
SDL_VideoDisplay *display = _this->displays[i];
15211518
Wayland_free_display(display, false);
15221519
}
@@ -1526,6 +1523,8 @@ static void Wayland_VideoCleanup(SDL_VideoDevice *_this)
15261523
Wayland_SeatDestroy(seat, false);
15271524
}
15281525

1526+
Wayland_FiniMouse(data);
1527+
15291528
if (data->pointer_constraints) {
15301529
zwp_pointer_constraints_v1_destroy(data->pointer_constraints);
15311530
data->pointer_constraints = NULL;

0 commit comments

Comments
 (0)