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 502541 - Migrate to GTK 2.12 (tooltips and deprecations)
Migrate to GTK 2.12 (tooltips and deprecations)
Status: RESOLVED FIXED
Product: ekiga
Classification: Applications
Component: general
GIT master
Other All
: Normal enhancement
: ---
Assigned To: Jan Schampera
Ekiga maintainers
Depends on: 361678
Blocks:
 
 
Reported: 2007-12-08 18:24 UTC by Luis Menina
Modified: 2008-11-12 14:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch removing stuff deprecated in GTK 2.12 (10.40 KB, patch)
2007-12-08 18:31 UTC, Luis Menina
committed Details | Review
Kill remaining bits of libgnome/gnomevfs (4.96 KB, patch)
2008-11-11 23:10 UTC, Steve Frécinaux
needs-work Details | Review

Description Luis Menina 2007-12-08 18:24:38 UTC
GTK 2.12 has been out for a few months now. I open this bug so that we can track this effort and patches, once ekiga developers decide to switch from GTK 2.10 to GTK 2.12.
Comment 1 Luis Menina 2007-12-08 18:31:30 UTC
Created attachment 100597 [details] [review]
Patch removing stuff deprecated in GTK 2.12

This patch has already been reviewed by Snark in bug 361679.
It mainly addresses the GtkTooltips -> GtkTooltip migration and the deprecation of gtk_menu_item_remove_submenu.
Comment 2 Snark 2008-05-07 08:14:46 UTC
I'm annoyed to see your patch bitrotting :-(

I thought maybe I could at least commit the fix for the gtk_menu_item_remove_submenu, since that involved just using a function which does exist in GTK+ 2.10 ; hélas, I had a look here : http://svn.gnome.org/viewvc/gtk%2B/tags/GTK_2_10_9/gtk/gtkmenuitem.c?view=markup

It's clear that in GTK+ 2.10, gtk_menu_item_set_submenu can't really be used to remove a submenu, as that will trigger warnings when trying to execute the gtk_menu_attach_to_widget line (reported as bug #531904).

Damien, when do we switch to GTK+ 2.12?
Comment 3 Jan Schampera 2008-08-25 10:00:30 UTC
IMHO it's safe to.

J.
Comment 4 Snark 2008-08-25 11:41:22 UTC
gtk+ version 2.12.11 is available on win32, according to :
http://www.gtk.org/download-windows.html
Comment 5 Jan Schampera 2008-08-31 08:14:05 UTC
Reassigning to me, for the GtkTooltips deprecations.

Comment 6 Jan Schampera 2008-08-31 08:50:43 UTC
GtkTooltips removed.
Comment 7 Jan Schampera 2008-08-31 08:54:45 UTC
gtk_menu_item_remove_submenu() removed.

Though I did it manually because the patch was a bit older, there were no changes needed to the patch. Thanks for it.

Next things to do:
The combo boxes API has changed :(
Comment 8 Jan Schampera 2008-08-31 09:28:08 UTC
Just for the record:

Unable to compile with GTK_DISABLE_DEPRECATED because of libgnomeui is not GTK-2.12 ready (it seems).

...


Comment 9 Snark 2008-08-31 16:19:23 UTC
Jan :
(1) using gtk_menu_item_set_submenu (item, NULL) to remove the submenu doesn't work in gtk+ 2.10 afaik -- and this is the version we ask in configure.ac ;
(2) gtk_widget_set_tooltip_text is new in gtk+ 2.12, which doesn't work with 2.10, and this is the version we ask in configure.ac ;
(3) ubuntu edgy doesn't have gtk+ 2.12, only the newer has, so it's perhaps too early to switch to gtk+ 2.12.

Damien?
Comment 10 Jan Schampera 2008-08-31 20:28:03 UTC
Julien,

to (1):
We can't bump the version request when there's still deprecated code, it's work in progress. Or should it go vice versa?

to (2):
What is Edgy based on? My personal indicator for "bleeding edge" is the *very conservative* Debian. The upcoming stable (Lenny) has 2.12.11 here. Though I have trouble to compile against libgnomeui here...

Comment 11 Jan Schampera 2008-08-31 21:01:53 UTC
For the record: GNOME_DISABLE_DEPRECATED also exists... *doh* my bad
Comment 12 Jan Schampera 2008-08-31 22:19:16 UTC
I tested around a bit. We don't use old GtkCombo* API.

The GNOME libraries compiled with GNOME_DISABLE_DEPRECATED lack the definition of _() and N_(). These were moved to libbonobo. So everywhere we #include <gnome.h> to have I18N, an #include <libbonobo.h> should fix it.

J.
Comment 13 Jan Schampera 2008-09-01 16:00:29 UTC
Ok, we have go from mission control. I'll investigate.
Comment 14 Jan Schampera 2008-09-01 17:33:50 UTC
Okay, changes summary:
- _() and N_() are done by libbonobo now (before: libgnome)
- GLib main loop API changed
- GTK menu item API changed
- GTK tooltips API changed

The code compiles fine with CPPFLAGS="-DG_DISABLE_DEPRECATED=1 -DGTK_DISABLE_DEPRECATED=1 -DGNOME_DISABLE_DEPRECATED=1", except:
In file included from /usr/include/orbit-2.0/orbit/dynamic/dynamic.h:4,
                 from /usr/include/orbit-2.0/orbit/orbit.h:19,
                 from /usr/include/orbit-2.0/orbit/orb-core/orbit-interface.h:738,
                 from /usr/include/bonobo-activation-2.0/bonobo-activation/Bonobo_Unknown.h:78,
                 from /usr/include/bonobo-activation-2.0/bonobo-activation/bonobo-activation.h:27,
                 from /usr/include/libbonobo-2.0/bonobo/bonobo-object.h:14,
                 from /usr/include/libbonobo-2.0/bonobo/bonobo-types.h:16,
                 from /usr/include/libbonobo-2.0/libbonobo.h:18,
                 from gui/statusicon.cpp:59:
/usr/include/orbit-2.0/orbit/dynamic/dynamic-defs.h:673: warning: ‘CORBA_TypeCode_struct* DynamicAny_DynAny_type(DynamicAny_DynAny_type*, CORBA_Environment*)’ hides constructor for ‘struct DynamicAny_DynAny_type’

But that shouldn't hurt (us).

Changes committed, I hope everything works well. Closing.

J.

Comment 15 Snark 2008-09-01 18:01:33 UTC
Notice that _() and N_() are gettext, and hence isn't really gnome-specific.
Comment 16 Jan Schampera 2008-09-01 18:22:48 UTC
gettext is used when !HAVE_GNOME, Gnome (before) and Bonobo (now) have replacements for it. Though I don't know if it's safe to assume we have Bonobo when we HAVE_GNOME...

J.
Comment 17 Snark 2008-09-01 20:17:23 UTC
I think we have a few #if GTK_HAVE_VERSION (...) in the code, which should probably be removed now we assume a higher version.

Reopening, as it irks me to discuss a not-so-FIXED bug.
Comment 18 Jan Schampera 2008-09-02 16:27:14 UTC
Full ACK - what would I do without you!

Comment 19 Jan Schampera 2008-09-02 18:19:50 UTC
Cleaned the code from version checks below 2.12.0 (still found some 2.8 one hehe), bumped version check in configure.ac.

Leaving open for comments. Also having a look for versions of supporting libraries like GLib.

J.
Comment 20 Peter Robinson 2008-09-04 21:24:52 UTC
Just a couple of notes.

not sure what we use from libgnome but its in the gnome kill list 
http://live.gnome.org/LibgnomeMustDie

Ekiga is also on the gio port todo list but I don't see any gnome_vfs calls in the current svn code, so I suspect it doesn't any more and someone in the know just has to update the gnome wiki.
http://live.gnome.org/GioPort

This is also worth a look.
http://live.gnome.org/ProjectRidley
Comment 21 Jan Schampera 2008-09-05 03:54:04 UTC
Yea, I know about massive GNOME changes, but it's not a good time (yet) to start this IMHO.

J.
Comment 22 Steve Frécinaux 2008-09-05 07:27:51 UTC
(In reply to comment #20)

> Ekiga is also on the gio port todo list but I don't see any gnome_vfs calls in
> the current svn code, so I suspect it doesn't any more and someone in the know
> just has to update the gnome wiki.
> http://live.gnome.org/GioPort

AFAIR Ekiga just uses the GnomeVFS backend for the open dialog. It was waiting for the proper GIO backend to be integrated into Gtk+.
Comment 23 Jan Schampera 2008-09-08 04:32:18 UTC
This all should be finished in Ekiga 3.2 IMHO.

Currently (heading for 3.0) there's too much other hassle.
Comment 24 Steve Frécinaux 2008-11-11 23:10:18 UTC
Created attachment 122455 [details] [review]
Kill remaining bits of libgnome/gnomevfs

This drops the dependency against libgnome when at least gtk 2.13 is available
Comment 25 Luis Menina 2008-11-11 23:33:03 UTC
(In reply to comment #24)
> Created an attachment (id=122455) [edit]
> Kill remaining bits of libgnome/gnomevfs
> 
> This drops the dependency against libgnome when at least gtk 2.13 is available
> 

Seems that the patch uses this to check the GTK version:
#if GTK_MAJOR_VERSION > 2 || GTK_MINOR_VERSION >= 13

This can't work. First, the major is checked with '>' instead of '>=', and the condition used should use a logical and (&&) instead of logical or (||).

To avoid this kind of problems, use GTK_CHECK_VERSION() instead. I have not enough knowledge on the other aspects of the patch to review them, so I invite others reviewers to add some comments.
Comment 26 Steve Frécinaux 2008-11-12 10:06:13 UTC
I tried using GTK_CHECK_VERSION but it didn't seem to work in an #if statement...

Also, this works just fine because either you use a GTK_MAJOR_VERSION > 2 (say, 3.0.0), or you use GTK_MINOR_VERSION >= 13 (for 2.13.1). Gtk 1.X are not supported by Ekiga anyway.
Comment 27 Luis Menina 2008-11-12 10:28:44 UTC
Sure, but the semantics are a bit broken, especially for the GTK_VERSION_MINOR check. 

GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 13 is clearer and cleaner.
And last time I used GTK_CHECK_VERSION in a #if, it worked. Please try again to use it, if it doesn't work, there's a bug somewhere...
Comment 28 Steve Frécinaux 2008-11-12 10:32:13 UTC
> GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 13 is clearer and cleaner.

... and wrong: it won't work for 3.0 for instance.


> Please try again to use it, if it doesn't work, there's a bug somewhere...

Will do.
Comment 29 Steve Frécinaux 2008-11-12 10:36:45 UTC
toolbox-gtk.c:47:22: error: missing binary operator before token "("

The line is:

#if GTK_CHECK_VERSION(2, 13, 1)
Comment 30 Steve Frécinaux 2008-11-12 10:44:21 UTC
Okay I found the bug. Now it works.

Commited the fixed version with the agreement of Damien Sandras.
Comment 31 Luis Menina 2008-11-12 14:05:03 UTC
(In reply to comment #28)
> > GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 13 is clearer and cleaner.
> 
> ... and wrong: it won't work for 3.0 for instance.

Oh, I'm sorry, you're right. Should have been
GTK_MAJOR_VERSION > 2 || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 13)

But it's great if you found how to make GTK_CHECK_VERSION do the work for you.