gdk: Add gdk_event_get_seat()

It currently fetches the seat from the event device, will be changed
in future commits.
This commit is contained in:
Carlos Garnacho 2020-06-23 01:14:53 +02:00
parent 6d2860efb7
commit cf1fbdf8b5
2 changed files with 19 additions and 0 deletions

View File

@ -1185,6 +1185,22 @@ gdk_event_get_surface (GdkEvent *event)
return event->surface; return event->surface;
} }
/**
* gdk_event_get_seat:
* @event: a #GdkEvent.
*
* Returns the seat that originated the event.
*
* Returns: (nullable) (transfer none): a #GdkSeat.
*/
GdkSeat *
gdk_event_get_seat (GdkEvent *event)
{
g_return_val_if_fail (GDK_IS_EVENT (event), NULL);
return event->device ? gdk_device_get_seat (event->device) : NULL;
}
/** /**
* gdk_event_get_device: * gdk_event_get_device:
* @event: a #GdkEvent. * @event: a #GdkEvent.

View File

@ -344,6 +344,9 @@ GdkEventType gdk_event_get_event_type (GdkEvent *event);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkSurface * gdk_event_get_surface (GdkEvent *event); GdkSurface * gdk_event_get_surface (GdkEvent *event);
GDK_AVAILABLE_IN_ALL
GdkSeat * gdk_event_get_seat (GdkEvent *event);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GdkDevice * gdk_event_get_device (GdkEvent *event); GdkDevice * gdk_event_get_device (GdkEvent *event);