GNOME Bugzilla – Bug 764964
Build fails because gdk_display_get_device_manager is deprecated
Last modified: 2016-04-29 12:58:00 UTC
Created attachment 325820 [details] [review] Use the new suggested method - which has been added in 3.20! make[3]: Entering directory '/home/aleb/dev/pitivi/gst-devtools/validate/plugins/gtk' CC libgstvalidategtk_la-gstvalidategtk.lo gstvalidategtk.c: In function ‘get_device’: gstvalidategtk.c:85:3: error: ‘gdk_display_get_device_manager’ is deprecated: Use 'gdk_display_get_default_seat' instead [-Werror=deprecated-declarations] dev_manager = gdk_display_get_device_manager (gdk_display_get_default ()); ^ In file included from /usr/include/gtk-3.0/gdk/gdkscreen.h:32:0, from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:31, from /usr/include/gtk-3.0/gdk/gdk.h:32, from /usr/include/gtk-3.0/gtk/gtk.h:30, from gstvalidategtk.c:31: /usr/include/gtk-3.0/gdk/gdkdisplay.h:170:20: note: declared here GdkDeviceManager * gdk_display_get_device_manager (GdkDisplay *display); ^ gstvalidategtk.c:87:7: error: ‘gdk_device_manager_list_devices’ is deprecated [-Werror=deprecated-declarations] gdk_device_manager_list_devices (dev_manager, GDK_DEVICE_TYPE_MASTER); ^ In file included from /usr/include/gtk-3.0/gdk/gdkdisplay.h:32:0, from /usr/include/gtk-3.0/gdk/gdkscreen.h:32, from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:31, from /usr/include/gtk-3.0/gdk/gdk.h:32, from /usr/include/gtk-3.0/gtk/gtk.h:30, from gstvalidategtk.c:31: /usr/include/gtk-3.0/gdk/gdkdevicemanager.h:41:14: note: declared here GList * gdk_device_manager_list_devices (GdkDeviceManager *device_manager, ^ cc1: all warnings being treated as errors Makefile:603: recipe for target 'libgstvalidategtk_la-gstvalidategtk.lo' failed make[3]: *** [libgstvalidategtk_la-gstvalidategtk.lo] Error 1 make[3]: Leaving directory '/home/aleb/dev/pitivi/gst-devtools/validate/plugins/gtk'
Comment on attachment 325820 [details] [review] Use the new suggested method - which has been added in 3.20! This needs to be conditional only if GTK 3.20 is available. That version is very new and we don't really want to depend on that already. Needs some #ifdefs here.
Created attachment 325882 [details] [review] #if GTK_CHECK_VERSION(3,20,0) Done
Review of attachment 325882 [details] [review]: ::: validate/plugins/gtk/gstvalidategtk.c @@ +143,3 @@ return NULL; } +#if GTK_CHECK_VERSION(3,20,0) I think that part should rather go into the get_device function
(In reply to Thibault Saunier from comment #3) > Review of attachment 325882 [details] [review] [review]: > > ::: validate/plugins/gtk/gstvalidategtk.c > @@ +143,3 @@ > return NULL; > } > +#if GTK_CHECK_VERSION(3,20,0) > > I think that part should rather go into the get_device function The new API can be used to get the master keyboard directly, there is no need for get_device anymore. If you insist, either we make get_device less generic and rename it to get_keyboard, or to keep it generic *maybe* we can use https://developer.gnome.org/gdk3/stable/GdkSeat.html#gdk-seat-get-slaves with accepts a GdkSeatCapabilities parameter (instead of GdkInputSource). Basically: - gdk_seat_get_slaves does: return seat_class->get_slaves (seat, capabilities); - gdk_seat_get_keyboard does: return seat_class->get_master (seat, GDK_SEAT_CAPABILITY_KEYBOARD);