mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-04 07:10:15 +02:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user