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 689371 - GIMP uses deprecated GtkHSV widget
GIMP uses deprecated GtkHSV widget
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Normal minor
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2012-11-30 18:43 UTC by Alex Valavanis
Modified: 2013-01-08 12:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Video showing loss of pointer tracking (607.33 KB, video/ogg)
2013-01-08 11:19 UTC, Alex Valavanis
Details

Description Alex Valavanis 2012-11-30 18:43:43 UTC
Hi, I'm part of the Inkscape development team...

Both of our projects currently use the GtkHSV widget to provide a "color wheel".  In GIMP, it is used in modules/color-selector-wheel.c.  This widget is deprecated in GTK+ 3 [1] and will eventually be removed.  We will need to adapt our code accordingly.  The issue is also being tracked in Inkscape [2].

I wonder if the GIMP devs have discussed this issue already.  If not, we've considered the following options.  I wonder if you had any other thoughts?

1. Stop providing a color-wheel widget in the application.

2. Adopt the GtkHSV code, and maintain it ourselves.

3. Make our own replacement color-wheel widget.

4. Other suggestions...??

[1] http://developer.gnome.org/gtk3/3.6/GtkHSV.html
[2] https://bugs.launchpad.net/inkscape/+bug/1071354
Comment 1 Michael Natterer 2012-11-30 19:10:38 UTC
With GTK+ master it's even totally broken, so gimp's gtk3-port branch
is unusable if the dialog is open. I plan to simply swallow it back into
gimp, where it originally came from.

The problem is currently not urgent, because gimp master uses gtk2.
Comment 2 Alex Valavanis 2012-11-30 19:30:02 UTC
OK, thanks for the quick update.  I think we're likely to adopt the code as well.
Comment 3 Michael Natterer 2012-11-30 19:35:05 UTC
Does Inkscape master use gtk3 already? I plan to swallow the widget
into the gtk3-port branch pretty soon, and give it some fixes. If it's
not urgent for you, you can simply wait and grab the fixed version later.
Comment 4 Alex Valavanis 2012-12-01 18:02:50 UTC
We don't officially support gtk3 yet, but we do provide a conditional (buggy) build against gtk3.

I guess it would make most sense for us to adopt your fixed version when it's ready and use it for gtk3 builds (and continue using GtkHSV for gtk2 builds).
Comment 5 Michael Natterer 2013-01-06 02:01:04 UTC
Fixed in master. Mot a gtk3 port yet, but at least clean gtk2 code,
will have to port it in the gtk3-port branch soon.

commit 632c577f18a7017e5a8f88745fd828ca068a42e7
Author: Michael Natterer <mitch@gimp.org>
Date:   Sun Jan 6 02:37:41 2013 +0100

    Bug 689371 - GIMP uses deprecated GtkHSV widget
    
    Swallow GtkHSV back into GIMP and call it GimpColorWheel. Keep it in
    modules/ for the time being. Clean up and undeprecate it. Replace
    set_metrics() API by set_ring_fraction() and make it follow the size
    of its parent container, making its use straightforward. Kept it clean
    of GIMP color types so it can be easily adapted by e.g. Inkscape.

 modules/Makefile.am            |    2 +-
 modules/color-selector-wheel.c |   49 +-
 modules/gimpcolorwheel.c       | 1473 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 modules/gimpcolorwheel.h       |   95 ++++
 4 files changed, 1580 insertions(+), 39 deletions(-)
Comment 6 Michael Natterer 2013-01-06 14:47:53 UTC
I have now ported it to gtk3, the commit message in the gtk3-port branch is:

modules: port GimpColorWheel to GTK+ 3.x

(the commit ID won't help much since that branch is regularly rebased)

Alex, if you try these files, can you tell me if you find any issues?
Comment 7 Alex Valavanis 2013-01-08 11:16:46 UTC
Hi Michael,

Thanks very much for this.  I have tested the original Gtk+ 2 version of the widget so we can be sure that my hacking hasn't affected anything.

The only change I had to make was to replace <libgimpmath/gimpmath.h> with plain <math.h>.  It seemed to provide all the necessary symbols.  Is this likely to cause any problems?

At first glance, the widget displays well and scales correctly within its container.  However, as I drag the selection indicator around inside the triangle, I notice two issues:

1. The selection indicator frequently jumps to seemingly random locations inside the triangle rather than consistently tracking the pointer

2. The triangle itself (and the corresponding selection indicator on the wheel) occasionally jitter clockwise/anticlockwise by a couple of degrees

Any thoughts?
Comment 8 Alex Valavanis 2013-01-08 11:19:48 UTC
Created attachment 232961 [details]
Video showing loss of pointer tracking

Here's a video demonstrating the problem
Comment 9 Alex Valavanis 2013-01-08 11:34:35 UTC
Oops... my mistake entirely, the problem was in the container widget in Inkscape.  Everything seems fine now.
Comment 10 Michael Natterer 2013-01-08 12:57:53 UTC
Great to hear :) The libgimpmath.h is just a GIMP convention, we include
it instead of math.h and it pulls in a bunch of gimp utilities, using
math.h instead is just fine.