GNOME Bugzilla – Bug 662903
Empathy uses deprecated GTK widgets (potential build errors)
Last modified: 2011-11-21 10:01:27 UTC
There are several uses of gtk_hbox_new, gtk_vbox_new, and others like: empathy-account-widget-sip.c:220:7: error: 'gtk_table_attach_defaults' is deprecated (declared at /opt/gnome/include/gtk-3.0/gtk/gtktable.h:126): Use 'GtkGrid' instead [-Werror=deprecated-declarations] empathy-account-widget-sip.c:260:7: error: 'gtk_table_attach_defaults' is deprecated (declared at /opt/gnome/include/gtk-3.0/gtk/gtktable.h:126): Use 'GtkGrid' instead [-Werror=deprecated-declarations] cc1: all warnings being treated as errors With the latest version of GTK from master, and depending on build settings, these can get escalated from warnings to errors (as above).
Created attachment 200405 [details] [review] account-widget-*: port to GtkGrid
Created attachment 200406 [details] [review] contact-widget: port to GtkGrid
Created attachment 200407 [details] [review] dialpad-widget: port to GtkGrid
Created attachment 200408 [details] [review] individual-widget: port to GtkGrid
Created attachment 200409 [details] [review] main-window: port to GtkGrid
Those patches removed the last place where we were still using GtkTable.
Looks good. Difficult to review such patches, make sure to run each of those widgets to verify :)
I did! Merging.
Attachment 200405 [details] pushed as b26b85d - account-widget-*: port to GtkGrid Attachment 200406 [details] pushed as 96144de - contact-widget: port to GtkGrid Attachment 200407 [details] pushed as 2607985 - dialpad-widget: port to GtkGrid Attachment 200408 [details] pushed as 006f4b8 - individual-widget: port to GtkGrid Attachment 200409 [details] pushed as ad37787 - main-window: port to GtkGrid
I don't have a new GTK+ yet so please re-open this bug if thoses patches were not enough.
(In reply to comment #10) > I don't have a new GTK+ yet so please re-open this bug if thoses patches were > not enough. Your wish is my command. empathy-chat-text-view.c: In function 'chat_text_view_event_cb': empathy-chat-text-view.c:154:2: error: 'gdk_window_get_pointer' is deprecated (declared at /opt/gnome/include/gtk-3.0/gdk/gdkwindow.h:715): Use 'gdk_window_get_device_position' instead [-Werror=deprecated-declarations] empathy-chat-text-view.c: In function 'chat_text_view_populate_popup': empathy-chat-text-view.c:289:2: error: 'gtk_widget_get_pointer' is deprecated (declared at /opt/gnome/include/gtk-3.0/gtk/gtkwidget.h:756): Use 'gdk_window_get_device_position' instead [-Werror=deprecated-declarations] cc1: all warnings being treated as errors
Created attachment 201146 [details] [review] stop using gdk_window_get_pointer() It has been deprecated. gdk_window_get_device_position() has been added in GTK+ 3.0 so we're fine.
Created attachment 201147 [details] [review] stop using gtk_widget_get_pointer() It has been deprecated. I asked on #gtk+ and that seems to be the right way to do this. See http://git.gnome.org/browse/gtk+/commit/?id=2783158f8d9ca69e5a8fc4a903bfbcc3871a1b02 All these APIs are available since GTK+ 3.0 so we're good.
Review of attachment 201146 [details] [review]: ++
Review of attachment 201147 [details] [review]: This reminds me why I wish that populate-popup gave you the event. ++
Attachment 201146 [details] pushed as 19fe264 - stop using gdk_window_get_pointer() Attachment 201147 [details] pushed as 8f95b35 - stop using gtk_widget_get_pointer()
Merged. Travis: please let us know if that's fine now (I prefer to avoid updating my own GTK+ for now :)
Created attachment 201239 [details] Remaining build warnings
(In reply to comment #17) > Merged. > > Travis: please let us know if that's fine now (I prefer to avoid updating my > own GTK+ for now :) There are still tons of deprecated symbols (search for "deprecated" in attachment #201239 [details]). Most seem to be GtkVBox and GtkHBox, though I saw at least one GtkHPaned function. You could always move your development prefix aside, run "jhbuild build empathy", turn deprecation enforcement back on, and fix the problems until it builds.
Humm there is no GTK equivalent of GLIB_DISABLE_DEPRECATION_WARNINGS so the best for now is to build your Empathy with --disable-Werror. Looking at the build logs the remaining deprecated symbols are: - gtk_vbox_new and gtk_hbox_new - gtk_hseparator_new - gtk_hpaned_new
Created attachment 201550 [details] [review] use gtk_separator_new() instead of gtk_hseparator_new()
Created attachment 201551 [details] [review] use gtk_paned_new() instead of gtk_hpaned_new()
Created attachment 201553 [details] [review] use gtk_box_new() instead of gtk_[h,v]box_new()
+1 for those 3 patches.
Attachment 201550 [details] pushed as 211f86a - use gtk_separator_new() instead of gtk_hseparator_new() Attachment 201551 [details] pushed as bd43c34 - use gtk_paned_new() instead of gtk_hpaned_new() Attachment 201553 [details] pushed as 76d7709 - use gtk_box_new() instead of gtk_[h,v]box_new()