wayland: Use wl_seat_get_version()

This commit is contained in:
Benjamin Otte 2023-04-01 02:21:47 +02:00
parent 6f93f52b56
commit b4492a97bf
3 changed files with 7 additions and 16 deletions

View File

@ -235,10 +235,9 @@ _gdk_wayland_display_add_seat (GdkWaylandDisplay *display_wayland,
{
struct wl_seat *seat;
display_wayland->seat_version = MIN (version, 8);
seat = wl_registry_bind (display_wayland->wl_registry,
id, &wl_seat_interface,
display_wayland->seat_version);
MIN (version, 8));
_gdk_wayland_display_create_seat (display_wayland, id, seat);
_gdk_wayland_display_async_roundtrip (display_wayland);
}

View File

@ -133,8 +133,6 @@ struct _GdkWaylandDisplay
GSource *event_source;
int seat_version;
uint32_t server_decoration_mode;
struct xkb_context *xkb_context;

View File

@ -523,7 +523,6 @@ flush_discrete_scroll_event (GdkWaylandSeat *seat,
gint value120_x,
gint value120_y)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
GdkEvent *event = NULL;
GdkDevice *source;
GdkScrollDirection direction;
@ -539,7 +538,7 @@ flush_discrete_scroll_event (GdkWaylandSeat *seat,
source = get_scroll_device (seat, seat->pointer_info.frame.source);
if (display_wayland->seat_version >= WL_POINTER_AXIS_VALUE120_SINCE_VERSION)
if (wl_seat_get_version (seat->wl_seat) >= WL_POINTER_AXIS_VALUE120_SINCE_VERSION)
{
event = gdk_scroll_event_new_value120 (seat->pointer_info.focus,
source,
@ -668,7 +667,6 @@ pointer_handle_enter (void *data,
{
GdkWaylandSeat *seat = data;
GdkEvent *event;
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
if (!surface)
return;
@ -702,7 +700,7 @@ pointer_handle_enter (void *data,
"enter, seat %p surface %p",
seat, seat->pointer_info.focus);
if (display_wayland->seat_version < WL_POINTER_HAS_FRAME)
if (wl_seat_get_version (seat->wl_seat) < WL_POINTER_HAS_FRAME)
gdk_wayland_seat_flush_frame_event (seat);
}
@ -714,7 +712,6 @@ pointer_handle_leave (void *data,
{
GdkWaylandSeat *seat = data;
GdkEvent *event;
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
GdkDeviceGrabInfo *grab;
if (!seat->pointer_info.focus)
@ -758,7 +755,7 @@ pointer_handle_leave (void *data,
if (seat->cursor)
gdk_wayland_seat_stop_cursor_animation (seat, &seat->pointer_info);
if (display_wayland->seat_version < WL_POINTER_HAS_FRAME)
if (wl_seat_get_version (seat->wl_seat) < WL_POINTER_HAS_FRAME)
gdk_wayland_seat_flush_frame_event (seat);
}
@ -770,7 +767,6 @@ pointer_handle_motion (void *data,
wl_fixed_t sy)
{
GdkWaylandSeat *seat = data;
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
GdkEvent *event;
if (!seat->pointer_info.focus)
@ -798,7 +794,7 @@ pointer_handle_motion (void *data,
x, y, seat, gdk_event_get_modifier_state (event));
}
if (display->seat_version < WL_POINTER_HAS_FRAME)
if (wl_seat_get_version (seat->wl_seat) < WL_POINTER_HAS_FRAME)
gdk_wayland_seat_flush_frame_event (seat);
}
@ -811,7 +807,6 @@ pointer_handle_button (void *data,
uint32_t state)
{
GdkWaylandSeat *seat = data;
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
GdkEvent *event;
uint32_t modifier;
int gdk_button;
@ -878,7 +873,7 @@ pointer_handle_button (void *data,
seat,
gdk_event_get_modifier_state (event));
if (display->seat_version < WL_POINTER_HAS_FRAME)
if (wl_seat_get_version (seat->wl_seat) < WL_POINTER_HAS_FRAME)
gdk_wayland_seat_flush_frame_event (seat);
}
@ -909,7 +904,6 @@ pointer_handle_axis (void *data,
{
GdkWaylandSeat *seat = data;
GdkWaylandPointerFrameData *pointer_frame = &seat->pointer_info.frame;
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
if (!seat->pointer_info.focus)
return;
@ -934,7 +928,7 @@ pointer_handle_axis (void *data,
get_axis_name (axis), wl_fixed_to_double (value),
seat);
if (display->seat_version < WL_POINTER_HAS_FRAME)
if (wl_seat_get_version (seat->wl_seat) < WL_POINTER_HAS_FRAME)
gdk_wayland_seat_flush_frame_event (seat);
}