After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662903 - Empathy uses deprecated GTK widgets (potential build errors)
Empathy uses deprecated GTK widgets (potential build errors)
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
3.3.x
Other Linux
: Normal normal
: 3.4
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-27 21:50 UTC by Travis Reitter
Modified: 2011-11-21 10:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
account-widget-*: port to GtkGrid (81.18 KB, patch)
2011-11-01 15:02 UTC, Guillaume Desmottes
committed Details | Review
contact-widget: port to GtkGrid (17.47 KB, patch)
2011-11-01 15:02 UTC, Guillaume Desmottes
committed Details | Review
dialpad-widget: port to GtkGrid (1.85 KB, patch)
2011-11-01 15:02 UTC, Guillaume Desmottes
committed Details | Review
individual-widget: port to GtkGrid (2.92 KB, patch)
2011-11-01 15:02 UTC, Guillaume Desmottes
committed Details | Review
main-window: port to GtkGrid (5.21 KB, patch)
2011-11-01 15:03 UTC, Guillaume Desmottes
committed Details | Review
stop using gdk_window_get_pointer() (1.01 KB, patch)
2011-11-10 12:18 UTC, Guillaume Desmottes
committed Details | Review
stop using gtk_widget_get_pointer() (2.20 KB, patch)
2011-11-10 12:18 UTC, Guillaume Desmottes
committed Details | Review
Remaining build warnings (44.26 KB, text/plain)
2011-11-11 16:12 UTC, Travis Reitter
  Details
use gtk_separator_new() instead of gtk_hseparator_new() (1.03 KB, patch)
2011-11-16 15:35 UTC, Guillaume Desmottes
committed Details | Review
use gtk_paned_new() instead of gtk_hpaned_new() (954 bytes, patch)
2011-11-16 15:35 UTC, Guillaume Desmottes
committed Details | Review
use gtk_box_new() instead of gtk_[h,v]box_new() (24.66 KB, patch)
2011-11-16 16:19 UTC, Guillaume Desmottes
committed Details | Review

Description Travis Reitter 2011-10-27 21:50:51 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).
Comment 1 Guillaume Desmottes 2011-11-01 15:02:49 UTC
Created attachment 200405 [details] [review]
account-widget-*: port to GtkGrid
Comment 2 Guillaume Desmottes 2011-11-01 15:02:52 UTC
Created attachment 200406 [details] [review]
contact-widget: port to GtkGrid
Comment 3 Guillaume Desmottes 2011-11-01 15:02:55 UTC
Created attachment 200407 [details] [review]
dialpad-widget: port to GtkGrid
Comment 4 Guillaume Desmottes 2011-11-01 15:02:58 UTC
Created attachment 200408 [details] [review]
individual-widget: port to GtkGrid
Comment 5 Guillaume Desmottes 2011-11-01 15:03:01 UTC
Created attachment 200409 [details] [review]
main-window: port to GtkGrid
Comment 6 Guillaume Desmottes 2011-11-01 15:03:28 UTC
Those patches removed the last place where we were still using GtkTable.
Comment 7 Xavier Claessens 2011-11-01 15:47:49 UTC
Looks good.

Difficult to review such patches, make sure to run each of those widgets to verify :)
Comment 8 Guillaume Desmottes 2011-11-02 08:32:49 UTC
I did! Merging.
Comment 9 Guillaume Desmottes 2011-11-02 08:34:16 UTC
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
Comment 10 Guillaume Desmottes 2011-11-02 08:48:47 UTC
I don't have a new GTK+ yet so please re-open this bug if thoses patches were not enough.
Comment 11 Travis Reitter 2011-11-09 23:15:38 UTC
(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
Comment 12 Guillaume Desmottes 2011-11-10 12:18:04 UTC
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.
Comment 13 Guillaume Desmottes 2011-11-10 12:18:07 UTC
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.
Comment 14 Danielle Madeley 2011-11-10 23:55:04 UTC
Review of attachment 201146 [details] [review]:

++
Comment 15 Danielle Madeley 2011-11-10 23:59:37 UTC
Review of attachment 201147 [details] [review]:

This reminds me why I wish that populate-popup gave you the event.

++
Comment 16 Guillaume Desmottes 2011-11-11 08:30:16 UTC
Attachment 201146 [details] pushed as 19fe264 - stop using gdk_window_get_pointer()
Attachment 201147 [details] pushed as 8f95b35 - stop using gtk_widget_get_pointer()
Comment 17 Guillaume Desmottes 2011-11-11 08:31:12 UTC
Merged.

Travis: please let us know if that's fine now (I prefer to avoid updating my own GTK+ for now :)
Comment 18 Travis Reitter 2011-11-11 16:12:58 UTC
Created attachment 201239 [details]
Remaining build warnings
Comment 19 Travis Reitter 2011-11-11 16:15:45 UTC
(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.
Comment 20 Guillaume Desmottes 2011-11-16 15:25:43 UTC
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
Comment 21 Guillaume Desmottes 2011-11-16 15:35:11 UTC
Created attachment 201550 [details] [review]
use gtk_separator_new() instead of gtk_hseparator_new()
Comment 22 Guillaume Desmottes 2011-11-16 15:35:16 UTC
Created attachment 201551 [details] [review]
use gtk_paned_new() instead of gtk_hpaned_new()
Comment 23 Guillaume Desmottes 2011-11-16 16:19:36 UTC
Created attachment 201553 [details] [review]
use gtk_box_new() instead of gtk_[h,v]box_new()
Comment 24 Xavier Claessens 2011-11-21 09:46:26 UTC
+1 for those 3 patches.
Comment 25 Guillaume Desmottes 2011-11-21 10:01:17 UTC
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()