summaryrefslogtreecommitdiff
path: root/gdk/gdkevents.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-10-25 13:50:55 +0200
committerCarlos Garnacho <carlosg@gnome.org>2017-12-14 00:58:32 +0100
commit8595e4b1d17a7453ba8afeab0c61d69bd27b8da3 (patch)
tree99dac9abeb2df230cf09f901c971f149498a6e47 /gdk/gdkevents.c
parent526486da6be424b055a8e988b7f2e95625a696c6 (diff)
downloadgtk+-8595e4b1d17a7453ba8afeab0c61d69bd27b8da3.tar.gz
gdk: Figure out the GdkSeat of an event from the GdkDevice
Removes the need for gdk_event_set_seat() and the GdkSeat field from GdkEventPrivate.
Diffstat (limited to 'gdk/gdkevents.c')
-rw-r--r--gdk/gdkevents.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 18e45447c2..926463054c 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -525,7 +525,6 @@ gdk_event_copy (const GdkEvent *event)
GdkEventPrivate *private = (GdkEventPrivate *)event;
new_private->display = private->display;
- new_private->seat = private->seat;
g_set_object (&new_private->user_data, private->user_data);
}
@@ -1992,40 +1991,11 @@ gdk_event_get_event_type (const GdkEvent *event)
GdkSeat *
gdk_event_get_seat (const GdkEvent *event)
{
- const GdkEventPrivate *priv;
+ GdkDevice *device;
- if (!gdk_event_is_allocated (event))
- return NULL;
-
- priv = (const GdkEventPrivate *) event;
-
- if (!priv->seat)
- {
- GdkDevice *device;
-
- g_warning ("Event with type %d not holding a GdkSeat. "
- "It is most likely synthesized outside Gdk/GTK+",
- event->any.type);
-
- device = gdk_event_get_device (event);
-
- return device ? gdk_device_get_seat (device) : NULL;
- }
+ device = gdk_event_get_device (event);
- return priv->seat;
-}
-
-void
-gdk_event_set_seat (GdkEvent *event,
- GdkSeat *seat)
-{
- GdkEventPrivate *priv;
-
- if (gdk_event_is_allocated (event))
- {
- priv = (GdkEventPrivate *) event;
- priv->seat = seat;
- }
+ return device ? gdk_device_get_seat (device) : NULL;
}
/**