wayland/events: Names will always be sent before devices and capabilities

Wayland previously didn't specify that the seat name preceded the capabilities, but it is now specified that the name event must always come first. Remove the 'SDL_Set<device>Name()' functions that were only added to accommodate the case of compositors sending the name after the seat capabilities, as this clarification means that they are no longer needed.
This commit is contained in:
Frank Praznik
2025-05-28 12:37:59 -04:00
parent 45fa9dba16
commit 03fcbb4e46
7 changed files with 0 additions and 61 deletions

View File

@@ -2352,25 +2352,9 @@ static void seat_handle_capabilities(void *data, struct wl_seat *wl_seat, enum w
static void seat_handle_name(void *data, struct wl_seat *wl_seat, const char *name)
{
SDL_WaylandSeat *seat = (SDL_WaylandSeat *)data;
char name_fmt[256];
if (name && *name != '\0') {
seat->name = SDL_strdup(name);
if (seat->keyboard.wl_keyboard) {
SDL_snprintf(name_fmt, sizeof(name_fmt), "%s (%s)", WAYLAND_DEFAULT_KEYBOARD_NAME, seat->name);
SDL_SetKeyboardName(seat->keyboard.sdl_id, name_fmt);
}
if (seat->pointer.wl_pointer) {
SDL_snprintf(name_fmt, sizeof(name_fmt), "%s (%s)", WAYLAND_DEFAULT_POINTER_NAME, seat->name);
SDL_SetMouseName(seat->pointer.sdl_id, name_fmt);
}
if (seat->touch.wl_touch) {
SDL_snprintf(name_fmt, sizeof(name_fmt), "%s (%s)", WAYLAND_DEFAULT_TOUCH_NAME, seat->name);
SDL_SetTouchName((SDL_TouchID)(uintptr_t)seat->touch.wl_touch, name_fmt);
}
}
}