From a22c16a11225896b4815f11c0b648c330d43b026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandru=20B=C4=83lu=C8=9B?= Date: Wed, 13 Apr 2016 21:18:28 +0200 Subject: [PATCH] validate: Stop using deprecated method https://bugzilla.gnome.org/show_bug.cgi?id=764964 --- validate/plugins/gtk/gstvalidategtk.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/validate/plugins/gtk/gstvalidategtk.c b/validate/plugins/gtk/gstvalidategtk.c index c2d3fc25e4..a6fe92eed5 100644 --- a/validate/plugins/gtk/gstvalidategtk.c +++ b/validate/plugins/gtk/gstvalidategtk.c @@ -75,6 +75,7 @@ get_event_type (GstValidateScenario * scenario, GstValidateAction * action) return -2; } +#if ! GTK_CHECK_VERSION(3,20,0) static GdkDevice * get_device (GstValidateAction * action, GdkInputSource input_source) { @@ -97,6 +98,7 @@ get_device (GstValidateAction * action, GdkInputSource input_source) return device; } +#endif static GdkEvent * _create_key_event (GdkWindow * window, GdkEventType etype, guint keyval, @@ -123,6 +125,10 @@ _create_keyboard_events (GstValidateAction * action, GdkEventType etype) { guint *keys; +#if GTK_CHECK_VERSION(3,20,0) + GdkDisplay *display; + GdkSeat *seat; +#endif GList *events = NULL; GdkDevice *device = NULL; @@ -136,8 +142,21 @@ _create_keyboard_events (GstValidateAction * action, return NULL; } +#if GTK_CHECK_VERSION(3,20,0) + display = gdk_display_get_default (); + if (display == NULL) { + GST_VALIDATE_REPORT (action->scenario, + g_quark_from_static_string ("scenario::execution-error"), + "Could not find a display"); + return NULL; + } + + seat = gdk_display_get_default_seat (display); + device = gdk_seat_get_keyboard (seat); +#else device = get_device (action, GDK_SOURCE_KEYBOARD); +#endif if (device == NULL) { GST_VALIDATE_REPORT (action->scenario, g_quark_from_static_string ("scenario::execution-error"),