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 577469 - Remove deprecated GTK+ symbols
Remove deprecated GTK+ symbols
Status: RESOLVED FIXED
Product: gdl
Classification: Other
Component: general
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: Anjuta maintainers
Anjuta maintainers
: 612572 (view as bug list)
Depends on: 622186 622581
Blocks: 585692
 
 
Reported: 2009-03-31 15:08 UTC by André Klapper
Modified: 2010-06-27 08:18 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
This patch removes deprecated Gtk+ macros (16.35 KB, patch)
2010-04-12 19:09 UTC, Mirsal Ennaime
none Details | Review
Remove deprecated Gtk+ macros and bump GTK_REQUIRED to 2.19.7 (16.68 KB, patch)
2010-04-12 23:15 UTC, Mirsal Ennaime
none Details | Review
Remove a call to the deprecated gtk_button_leave() function (3.00 KB, patch)
2010-06-04 03:48 UTC, Mirsal Ennaime
needs-work Details | Review
Fix the mistakes introduces by my previous patch (1.86 KB, patch)
2010-06-24 11:05 UTC, Mirsal Ennaime
committed Details | Review

Description André Klapper 2009-03-31 15:08:22 UTC
http://live.gnome.org/GnomeGoals/RemoveDeprecatedSymbols/GTK%2B

GTK_OBJECT_FLOATING, gtk_box_pack_start_defaults, gtk_object_sink, gtk_widget_ref, gtk_widget_unref


Contributors: Some stuff is really only about replacing the calls, some might be more complex. Also make sure that the gtk and glib versions in configure.in are high enough and take a look since which version the new non-deprecated functions are available. http://library.gnome.org is your friend. :-)
Comment 1 Johannes Schmid 2009-04-02 22:10:20 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 2 André Klapper 2010-04-12 17:32:21 UTC
Reopening as GTK_WIDGET_STATE and gtk_button_leave are used.

./gdl/gdl-dock-item.c:                   GTK_WIDGET_STATE (item));
./gdl/gdl-dock-item.c:                   GTK_WIDGET_STATE (widget),
l/.libs/libgdl-1.so.
./gdl/gdl-dock-item-grip.c:
          gtk_button_leave (GTK_BUTTON (grip->_priv->iconify_button));
Comment 3 Mirsal Ennaime 2010-04-12 19:09:53 UTC
Created attachment 158522 [details] [review]
This patch removes deprecated Gtk+ macros

Removed deprecated macros: GTK_WIDGET_DRAWABLE, GTK_WIDGET_REALIZED, GTK_WIDGET_STATE, GTK_WIDGET_VISIBLE, GTK_WIDGET_MAPPED, GTK_WIDGET_NO_WINDOW
Comment 4 André Klapper 2010-04-12 19:32:31 UTC
Mirsal: Patch is missing a GTK_REQUIRED bump to 2.19.7 in configure.in.
Comment 5 Mirsal Ennaime 2010-04-12 23:15:28 UTC
Created attachment 158557 [details] [review]
Remove deprecated Gtk+ macros and bump GTK_REQUIRED to 2.19.7
Comment 6 Mirsal Ennaime 2010-04-12 23:17:41 UTC
@André: Thanks !
Comment 7 Johannes Schmid 2010-04-18 19:50:59 UTC
Thanks for the patch! I pushed it to master!
Comment 8 André Klapper 2010-04-21 09:30:14 UTC
Hmm, but gtk_button_leave is still used:
./gdl/gdl-dock-item-grip.c:   
  gtk_button_leave (GTK_BUTTON (grip->_priv->iconify_button));
http://library.gnome.org/devel/gtk/unstable/GtkButton.html#gtk-button-leave
Comment 9 Johannes Schmid 2010-04-21 09:47:15 UTC
These are the things where you could silently write a patch and commit it ;)
Comment 10 Mirsal Ennaime 2010-04-21 10:03:52 UTC
Right, I forgot about this one, it did not show up when building with -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED

I can't write a patch right now, but I'll be happy to do so in a couple of days if noone takes care of it before :)
Comment 11 André Klapper 2010-04-21 11:03:43 UTC
(In reply to comment #9)
> These are the things where you could silently write a patch and commit it ;)

Yes, if I knew how to fix it. ;-)
Comment 12 Johannes Schmid 2010-06-01 21:19:15 UTC
@Mirsal: Does your offer with the patch still stand?
Comment 13 Mirsal Ennaime 2010-06-02 21:21:04 UTC
@Johannes: Oops, yeah, I got distracted and I forgot about this. I'm working on it now.
Comment 14 Johannes Schmid 2010-06-02 21:26:52 UTC
*** Bug 612572 has been marked as a duplicate of this bug. ***
Comment 15 Mirsal Ennaime 2010-06-04 03:48:36 UTC
Created attachment 162718 [details] [review]
Remove a call to the deprecated gtk_button_leave() function

Here is a (somewhat ridiculous) patch that replaces the gtk_button_leave() call that used to work around a gtk+ bug.

However, I think that the best thing to do here would be to just remove the gtk_button_leave() call : It is unlikely that anyone would need to listen to the leave event on the grip's iconify button. IMHO the bug that causes widgets not to fire leave-notify events when a widget gets reparented while being under the mouse pointer should be fixed in gtk+ in the first place.

Anyway, the code is here in case you think that the iconify button should emit a "leave-notify-event" signal.
Comment 16 Johannes Schmid 2010-06-10 15:23:48 UTC
Review of attachment 162718 [details] [review]:

To be honest, I don't know much about the leave-notify thing but I know that you can see a drawn focus shadow around the button if this is not done.

::: gdl/gdl-dock-item-grip.c
@@ +257,3 @@
 
+#if !GTK_CHECK_VERSION (2, 20, 0)
+  #define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)

This can be omitted as we would use GTK+ 2.20 as minimal.

@@ +291,3 @@
+    event->crossing.state = modifiers;
+
+    GTK_BUTTON (iconify_button)->in_button = FALSE;

I would assume that button->in_button also got GSEAL'd and is a such not available anymore.
Comment 17 Johannes Schmid 2010-06-22 16:29:12 UTC
It compiles now with GSEAL but the issue in the last comment is still present. Keeping the bug open.
Comment 18 Emmanuele Bassi (:ebassi) 2010-06-22 21:00:15 UTC
Review of attachment 162718 [details] [review]:

I agree that, as a workaround, emitting a ::leave-notify-event directly feels a bit of a hack; unfortunately, I don't think there's much we can do - since the explicit enter/leave methods have been removed.

::: gdl/gdl-dock-item-grip.c
@@ +291,3 @@
+    event->crossing.state = modifiers;
+
+    GTK_BUTTON (iconify_button)->in_button = FALSE;

this should not be needed: gtk_button_leave_notify() will already set in_button = FALSE.
Comment 19 Mirsal Ennaime 2010-06-23 19:32:27 UTC
yes, my previous patch uses the iconify button's parent gdk window to synthesize the crossing event whereas its event_window should be used. 

using:

window = GTK_BUTTON (iconify_button)->event_window;

everything works as intended and the in_button stuff can be removed, however, it is still a direct access to a GSEALed property and there is no other way to get the event_window from a GtkButton.

I'm not sure that adding an accessor for this one is a good idea, though.
Comment 20 Mirsal Ennaime 2010-06-23 19:40:38 UTC
oh and by the way, there is another thing I did not get right here : gtk_widget_event should be used instead of g_signal_emit_by_name
Comment 21 Mirsal Ennaime 2010-06-24 11:05:28 UTC
Created attachment 164494 [details] [review]
Fix the mistakes introduces by my previous patch

This patch need a new accessor in gtk+ (see: #616053)
Comment 22 Johannes Schmid 2010-06-24 11:31:34 UTC
Review of attachment 164494 [details] [review]:

Thanks! I think you linked to the wrong bug but should be fine.

::: gdl/gdl-dock-item-grip.c
@@ +260,3 @@
 }
 
+#if !GTK_CHECK_VERSION (2, 22, 0)

Hmm, not sure if I want to do a version for gtk+ 2.x but maybe I will branch one off. Master should depend on gtk+ 3.0.
Comment 23 André Klapper 2010-06-24 11:37:54 UTC
> +#if !GTK_CHECK_VERSION (2, 22, 0)

Uhm. No please, as 2.22 is somewhere in the next months but the accessor exists now, hence a real version (probably something 2.21ish is needed) to be able to compile gdl in the next months until 2.22.0 is released.
Comment 24 Johannes Schmid 2010-06-24 12:08:03 UTC
You got me wrong. I simply plan to depend on gtk+ 2.9x for the next release and leave the gtk+ 2.0 support to the stable gdl 2.30 series.
Comment 25 Johannes Schmid 2010-06-27 08:17:44 UTC
Review of attachment 164494 [details] [review]:

Committed