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 552513 - gtkmm does not build against GTK+ 2.14 on Windows
gtkmm does not build against GTK+ 2.14 on Windows
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: build
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2008-09-16 15:54 UTC by Armin Burgmeier
Modified: 2008-09-23 17:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkmm-2.13.7\gdk\gdkmm\display.h (989 bytes, patch)
2008-09-17 01:50 UTC, Damon Register
none Details | Review
gtkmm-2.13.7\gdk\gdkmm\display.cc (989 bytes, patch)
2008-09-17 01:51 UTC, Damon Register
none Details | Review
Proposed patch (17.30 KB, patch)
2008-09-18 13:09 UTC, Armin Burgmeier
committed Details | Review

Description Armin Burgmeier 2008-09-16 15:54:13 UTC
Two functions have changed their signature from GTK+ 2.12 to GTK+ 2.14:

gdk_drag_get_protocol_for_display now returns a GdkNativeWindow instead of a guint32, and gdk_selection_send_notify_for_display takes a GdkNativeWindow instead of a guint32 as second parameter. On linux, those two are probably the same. However, on Windows, they are not.

The C++ wrappers for these therefore do not compile on Windows.

For gdk_drag_get_protocol_for_display we can probably just change the return type, since this does not change the ABI (does it?)

For gdk_selection_send_notify_for_display we cannot simply change the parameter since this would break the ABI. I wonder whether we can simply add an overload for this, even if GdkNativeWindow and guint32 are the same on Linux. If not, then we could add the overload for Windows only.

Note that this is actually a slight API change. However, since GTK+ did the same change it's probably OK for us as long as the ABI stays compatible.

See also http://mail.gnome.org/archives/gtkmm-list/2008-September/msg00056.html.
Comment 1 Damon Register 2008-09-17 01:46:13 UTC
I can't say much about the compatibility issue but here is a fix that worked for me.  I used the modified gtkmm to build a simple app that works.
Comment 2 Damon Register 2008-09-17 01:50:56 UTC
Created attachment 118851 [details] [review]
gtkmm-2.13.7\gdk\gdkmm\display.h

updates to match the gtk functions
Comment 3 Damon Register 2008-09-17 01:51:59 UTC
Created attachment 118852 [details] [review]
gtkmm-2.13.7\gdk\gdkmm\display.cc

update to match the gtk functions
Comment 4 Damon Register 2008-09-18 12:14:52 UTC
I removed #define GTK_DISABLE_DEPRECATED from toolbar.ccg and toolbar.cc.
Compiling gtkmm 2.12.7 almost works but toolbar.cc compile fails at
Toolbar::get_tooltips_object()  with an error that says _tooltips
is not a member.  

The troublemaker seems to be gtktoolbar.h where GtkToolbar has this
member

#ifndef GTK_DISABLE_DEPRECATED
  GtkTooltips     *GSEAL (tooltips);
#else
  gpointer         GSEAL (_tooltips);
#endif

Why the name change (tooltips to _tooltips) in Gtk?  To force problems
like this to show up?

I suppose there are several solutions.  gtkmm could contain the
#ifndef GTK_DISABLE_DEPRECATED but that seems messy.  I could mask
the problem by keeping the #define GTK_DISABLE_DEPRECATED in
toolbar.cc

For now I just commented the cc function to see if there were any
other compile problems with the #define GTK_DISABLE_DEPRECATED removed.
It appears that is the only problem.  With the GdkNativeWindow fix
(patch submitted) and commenting out Toolbar::get_tooltips_object()
the gtkmm compiled ok.

Should gtk be fixed to eliminate that tooltip/_tooltip difference?
What is the best solution for this problem?
Comment 5 Armin Burgmeier 2008-09-18 12:53:29 UTC
As pointed out on the mailing list, the toolbar issue has already been fixed in recent versions of gtkmm. In the current toolbar.ccg, Toolbar::get_tooltips_object() always returns 0:

http://svn.gnome.org/viewvc/gtkmm/trunk/gtk/src/toolbar.ccg?view=markup
Comment 6 Armin Burgmeier 2008-09-18 13:09:27 UTC
Created attachment 118945 [details] [review]
Proposed patch

This patch fixes the issue by changing the parameters and return values of these functions to GdkNativeWindow, as proposed by Damon. On Linux, this is the same as guint32, so this is not a problem (I tested this). On Windows, the old functions are kept for compatibility.
Comment 7 Murray Cumming 2008-09-23 12:31:31 UTC
> gdk_selection_send_notify_for_display() we cannot simply change the parameter
since this would break the ABI.

This didn't seem to bother the GTK+ maintainers. If they can just change the types, why can't we?

Comment 8 Armin Burgmeier 2008-09-23 12:46:10 UTC
In C++, the types of a function's arguments are part of the ABI because the function can be overloaded. That's not the case in C.
Comment 9 Murray Cumming 2008-09-23 13:11:43 UTC
Oh, yeah, of course that's not true for C.

Please apply the patch, but please add real doxygen comments for those deprecated functions.

Comment 10 Armin Burgmeier 2008-09-23 17:25:14 UTC
2008-09-18  Armin Burgmeier  <armin@arbur.net>

        * gdk/src/gdk_methods.def: Regenerated.

        * gdk/src/display.hg:
        * gdk/src/display.ccg: Changed window ID parameters and return values
        for get_drag_protocol and selection_send_notify from guint32 to
        GdkNativeWindow. These are the same on Linux, so this is not a
        problem. On Windows, GdkNativeWindow is a pointer, so we keep the old
        functions to preserve ABI (doing some nasty casts in the
        implementation). Bug #552513 (Damon Register).