mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
gdk: Depend less on gdk_event_get_device()
For the most part, we are interested in seats here.
This commit is contained in:
parent
cf1fbdf8b5
commit
7be6afe84d
@ -2947,11 +2947,9 @@ gdk_surface_get_seat_from_event (GdkSurface *surface,
|
||||
{
|
||||
if (event)
|
||||
{
|
||||
GdkDevice *device = gdk_event_get_device (event);
|
||||
GdkSeat *seat = NULL;
|
||||
|
||||
if (device)
|
||||
seat = gdk_device_get_seat (device);
|
||||
seat = gdk_event_get_seat (event);
|
||||
|
||||
if (seat)
|
||||
return seat;
|
||||
|
@ -4886,10 +4886,9 @@ _gdk_wayland_display_remove_seat (GdkWaylandDisplay *display_wayland,
|
||||
}
|
||||
|
||||
uint32_t
|
||||
_gdk_wayland_device_get_implicit_grab_serial (GdkWaylandDevice *device,
|
||||
GdkEvent *event)
|
||||
_gdk_wayland_seat_get_implicit_grab_serial (GdkSeat *seat,
|
||||
GdkEvent *event)
|
||||
{
|
||||
GdkSeat *seat = gdk_device_get_seat (GDK_DEVICE (device));
|
||||
GdkEventSequence *sequence = NULL;
|
||||
GdkWaylandTouchData *touch = NULL;
|
||||
|
||||
|
@ -134,8 +134,8 @@ void _gdk_wayland_display_remove_seat (GdkWaylandDisplay *displa
|
||||
guint32 id);
|
||||
|
||||
GdkKeymap *_gdk_wayland_device_get_keymap (GdkDevice *device);
|
||||
uint32_t _gdk_wayland_device_get_implicit_grab_serial(GdkWaylandDevice *device,
|
||||
GdkEvent *event);
|
||||
uint32_t _gdk_wayland_seat_get_implicit_grab_serial(GdkSeat *seat,
|
||||
GdkEvent *event);
|
||||
uint32_t _gdk_wayland_seat_get_last_implicit_grab_serial (GdkWaylandSeat *seat,
|
||||
GdkEventSequence **seqence);
|
||||
struct wl_data_device * gdk_wayland_device_get_data_device (GdkDevice *gdk_device);
|
||||
|
@ -3830,8 +3830,8 @@ gdk_wayland_surface_show_window_menu (GdkSurface *surface,
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
|
||||
struct wl_seat *seat;
|
||||
GdkWaylandDevice *device;
|
||||
GdkSeat *seat;
|
||||
struct wl_seat *wl_seat;
|
||||
double x, y;
|
||||
uint32_t serial;
|
||||
|
||||
@ -3850,21 +3850,21 @@ gdk_wayland_surface_show_window_menu (GdkSurface *surface,
|
||||
if (!is_realized_toplevel (surface))
|
||||
return FALSE;
|
||||
|
||||
device = GDK_WAYLAND_DEVICE (gdk_event_get_device (event));
|
||||
seat = gdk_wayland_device_get_wl_seat (GDK_DEVICE (device));
|
||||
seat = gdk_event_get_seat (event);
|
||||
wl_seat = gdk_wayland_seat_get_wl_seat (seat);
|
||||
gdk_event_get_position (event, &x, &y);
|
||||
|
||||
serial = _gdk_wayland_device_get_implicit_grab_serial (device, event);
|
||||
serial = _gdk_wayland_seat_get_implicit_grab_serial (seat, event);
|
||||
|
||||
switch (display_wayland->shell_variant)
|
||||
{
|
||||
case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL:
|
||||
xdg_toplevel_show_window_menu (impl->display_server.xdg_toplevel,
|
||||
seat, serial, x, y);
|
||||
wl_seat, serial, x, y);
|
||||
break;
|
||||
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
|
||||
zxdg_toplevel_v6_show_window_menu (impl->display_server.zxdg_toplevel_v6,
|
||||
seat, serial, x, y);
|
||||
wl_seat, serial, x, y);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
|
@ -152,9 +152,8 @@ static void
|
||||
handle_touch_synthetic_crossing (GdkEvent *event)
|
||||
{
|
||||
GdkEventType evtype = gdk_event_get_event_type (event);
|
||||
GdkDevice *device = gdk_event_get_device (event);
|
||||
GdkEvent *crossing = NULL;
|
||||
GdkSeat *seat = gdk_device_get_seat (device);
|
||||
GdkSeat *seat = gdk_event_get_seat (event);
|
||||
gboolean needs_enter, set_needs_enter = FALSE;
|
||||
|
||||
if (quark_needs_enter == 0)
|
||||
@ -208,7 +207,7 @@ handle_touch_synthetic_crossing (GdkEvent *event)
|
||||
|
||||
if (crossing)
|
||||
{
|
||||
gdk_display_put_event (gdk_device_get_display (device), crossing);
|
||||
gdk_display_put_event (gdk_seat_get_display (seat), crossing);
|
||||
gdk_event_unref (crossing);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user