News from porting xfce4-notifyd

Matthew Barnes mbarnes at redhat.com
Tue Aug 4 15:31:05 CEST 2015


On 08/01/2015 11:54 AM, Simon Steinbeiß wrote:
> I quickly pulled and noticed that you're using some calls that were
> introduced with Gtk3.16, notably gtk_label_set_xalign and
> gtk_label_set_yalign. Please keep in mind that Xfce 4.14 targets
> Gtk>=3.14, so please use code that still works with Gtk3.14. (To the
> worst use ifdefs so things still build and work with Gtk3.14, I guess
> in your case it would be either gtk_label_set_justify or
> gtk_widget_set_h/valign. [1])

There's a good way to be warned about this kind dependency overreaching 
at compile time via the GDK_VERSION_MAX_ALLOWED definition.

Here's what I typically do in my configure.ac:


dnl Keep these two definitions in agreement.
m4_define([gdk_minimum_version], [3.14.0])
m4_define([gdk_encoded_version], [GDK_VERSION_3_14])

...

dnl Warn about API usage that exceeds our minimum requirement.
AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MAX_ALLOWED=gdk_encoded_version"

...

dnl These will suppress warnings about newly-deprecated symbols
dnl in later versions.  We'll care about them when we get there.
AM_CPPFLAGS="$AM_CPPFLAGS -DGDK_VERSION_MIN_REQUIRED=gdk_encoded_version"

...

PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= gdk_minimum_version])


HTH,
Matthew Barnes


More information about the Xfce4-dev mailing list