Closed Bug 1214953 Opened 9 years ago Closed 9 years ago

browser/components/shell/nsGNOMEShellService.cpp:583:22 [-Wdeprecated-declarations] 'gdk_color_parse' is deprecated

Categories

(Firefox :: Shell Integration, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 44
Tracking Status
firefox44 --- fixed

People

(Reporter: dholbert, Assigned: karlt)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Build warning, when building on Ubuntu 15.04:
{
browser/components/shell/nsGNOMEShellService.cpp:583:22 [-Wdeprecated-declarations] 'gdk_color_parse' is deprecated
}

Some googling brings me to this documentation:
> gboolean
> gdk_color_parse (const gchar *spec,
>                  GdkColor *color);
>
> gdk_color_parse has been deprecated since version 3.14
> and should not be used in newly-written code.
> 
> Use GdkRGBA
https://developer.gnome.org/gdk3/stable/gdk3-Colors.html#gdk-color-parse


Looks like it's deprecated in gtk3 (so we're getting this warning now that we build with gtk3 by default), and I think the replacement is:

> gboolean
> gdk_rgba_parse (GdkRGBA *rgba,
>                 const gchar *spec);
https://developer.gnome.org/gdk3/stable/gdk3-RGBA-Colors.html#gdk-rgba-parse
It would be nice to keep the gtk2 build working until there is a good reason to stop.

We should set GDK_VERSION_MIN_REQUIRED and GDK_VERSION_MAX_ALLOWED to GDK_VERSION_3_4, which will make many of these deprecation warnings go away.

This is already done for GLIB_VERSION_* in configure.in.

If AC_DEFINE_UNQUOTED causes problems for gtk2 plugin code, then I guess these could be set in MOZ_GTK3_CFLAGS.  widget/gtk/compat-gtk3/gdk/gdkversionmacros.h is another option.
This at least provides warnings if using symbols that are too new, and removes
the deprecated warning reported here.

There is much of the GTK2 API that we want to keep using at this stage but is
deprecated in 3.0, so we still get warnings for those.
gdkversionmacros.h asserts
"GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_3_0".

I wonder about going for the full GDK_DISABLE_DEPRECATION_WARNINGS, but
perhaps we can do that on per-compilation-unit basis where required.
(Docs say it should be set before including the GDK header.)

GDK_VERSION_MIN_REQUIRED in this patch is at least a safe step in the right
direction.
Attachment #8677104 - Flags: review?(mh+mozilla)
Assignee: nobody → karlt
Status: NEW → ASSIGNED
Attachment #8677104 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/f75a73d47315
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 44
See Also: → 1288702
Blocks: buildwarning
No longer depends on: buildwarning
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: