summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-25 22:39:15 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-03-26 11:09:05 -0400
commit7849590a82bb40dffdc40eb5bdd3c6ad239c00cc (patch)
treee112c49e0fc485ffeef5911850866875cf8a7c5e
parent61109800122643fa402f79e718be9d8812f874ed (diff)
downloadgtk+-7849590a82bb40dffdc40eb5bdd3c6ad239c00cc.tar.gz
gdk: Add gdk_device_get_timestamp
Give each device a timestamp that reflects the last user activity with that device, as reflected in the events that are produced for this device.
-rw-r--r--gdk/gdkevents.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index f7abfe75b5..43e9c9f01a 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -414,6 +414,9 @@ gdk_event_alloc (GdkEventType event_type,
event->device = device != NULL ? g_object_ref (device) : NULL;
event->time = time_;
+ if (device != NULL && time_ != GDK_CURRENT_TIME)
+ gdk_device_set_timestamp (device, time_);
+
return event;
}