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.
This commit is contained in:
Frank Praznik
2025-10-25 12:54:20 -04:00
parent 38df1c3138
commit acaf53926c

View File

@@ -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;