From 4dc440ff71e4bc2318079c5ce2a670af7204082a Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Fri, 13 Mar 2026 22:38:23 -0400 Subject: [PATCH] wayland: Eliminate redundant keyboard and mouse removals The SDL keyboard and mouse will be removed when destroying the seat, so there is no need to preemptively remove them. (cherry picked from commit 566448d95a2b3a79ac9418f19d57287ed13f6c00) --- src/video/wayland/SDL_waylandvideo.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index f2989897d1..a984f8db09 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -1373,17 +1373,12 @@ static void handle_registry_remove_global(void *data, struct wl_registry *regist } } - struct SDL_WaylandSeat *seat, *temp; + SDL_WaylandSeat *seat, *temp; wl_list_for_each_safe (seat, temp, &d->seat_list, link) { if (seat->registry_id == id) { - if (seat->keyboard.wl_keyboard) { - SDL_RemoveKeyboard(seat->keyboard.sdl_id); - } - if (seat->pointer.wl_pointer) { - SDL_RemoveMouse(seat->pointer.sdl_id); - } Wayland_SeatDestroy(seat, false); + return; } } }