GNOME Bugzilla – Bug 689371
GIMP uses deprecated GtkHSV widget
Last modified: 2013-01-08 12:57:53 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
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.
OK, thanks for the quick update. I think we're likely to adopt the code as well.
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.
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).
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(-)
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?
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?
Created attachment 232961 [details] Video showing loss of pointer tracking Here's a video demonstrating the problem
Oops... my mistake entirely, the problem was in the container widget in Inkscape. Everything seems fine now.
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.