[gtk/matthiasc/for-master: 2/2] gdk: Add an arg check to gdk_device_get_timestamp




commit 08f68cce403ae73014e03f5dc62640753f290ce7
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 26 11:09:50 2021 -0400

    gdk: Add an arg check to gdk_device_get_timestamp
    
    Pointed out by Emmanuele Bassi.

 gdk/gdkdevice.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index ea0b78fb28..b36ce7f708 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -1407,5 +1407,7 @@ gdk_device_set_timestamp (GdkDevice *device,
 guint32
 gdk_device_get_timestamp (GdkDevice *device)
 {
+  g_return_val_if_fail (GDK_IS_DEVICE (device), GDK_CURRENT_TIME);
+
   return device->timestamp;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]