Bug 407226 - GIMP 2.10 internal color picker doesn't work with "Color Picker" effect + OpenGL compositor backend
Summary: GIMP 2.10 internal color picker doesn't work with "Color Picker" effect + Ope...
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: scene-opengl (show other bugs)
Version: git master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: reproducible, usability
Depends on:
Blocks:
 
Reported: 2019-05-04 22:43 UTC by Yevhen Popok
Modified: 2019-05-07 09:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yevhen Popok 2019-05-04 22:43:40 UTC
SUMMARY
When kwin_x11 uses OpenGL 2/3 compositor backends, GIMP 2.10 can't get right color with built-in color picker.

STEPS TO REPRODUCE
1. Make sure you have compositing enabled with OpenGL backend
2. Install gimp 2.10.8+ (on Neon you can use ppa:otto-kesselgulasch/gimp)
3. Try to pick color

OBSERVED RESULT
GIMP picks color under mouse

EXPECTED RESULT
GIMP picks some color (black/blue) from Plasma theme


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE neon Unstable Edition
KDE Plasma Version: 5.15.80
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.0

ADDITIONAL INFORMATION
GIMP 2.8.12 from repos is not affected. Flatpak version also works fine (didn't test Snap).
After you switch backend to Xrender or "block compositing" from "Special Settings", color picker works properly.
I tried it also on Kubuntu (Plasma 5.12.x) with this PPA. Debian 10 (Plasma 5.14.5) & Mageia 7 (Plasma 5.15.4) have GIMP 2.10 in the official repos and there problem is also reproducible.
Comment 1 Yevhen Popok 2019-05-04 22:49:31 UTC
> OBSERVED RESULT
> GIMP picks color under mouse
> 
> EXPECTED RESULT
> GIMP picks some color (black/blue) from Plasma theme
Sorry, EXPECTED/OBSERVED must be vice versa. Unfortunately I'm unable to edit initial message.
Comment 2 Christoph Feck 2019-05-05 07:10:02 UTC
Could be a duplicate of bug 172921.

Please do not set the flags; they used by developers to request input from the usability team.
Comment 3 Yevhen Popok 2019-05-05 08:55:01 UTC
(In reply to Christoph Feck from comment #2)
> Could be a duplicate of bug 172921.
> 
I believe it's not the same bug. Those bugs tells that you can't pick a correct color because other window has been darkened. But here you can't pick any color (GIMP always returns black (#000) on most distributions or blue on Mageia (which has different theme by default). I should have added this to the first post.
---
Meanwhile I tried to disable all effects and figured out that the problem is with (surpise-surprise :) ) "Color Picker" effect (hidden under 'Internal Desktop Effects').
After I disable it GIMP even with OpenGL backend gets correct color.
Comment 4 Vlad Zahorodnii 2019-05-06 07:57:58 UTC
A bit stupid question: what tool do you use for color picking?
Comment 5 Yevhen Popok 2019-05-06 08:04:58 UTC
(In reply to Vlad Zagorodniy from comment #4)
> A bit stupid question: what tool do you use for color picking?
On toolbox on the left, under standard "tool" icons there's 2 colors (foreground/background). Click on one of them, then on the same line as "HTML notation" click on the 'eyedropper' icon.
Comment 6 Vlad Zahorodnii 2019-05-06 08:10:27 UTC
Thanks, I'm surprised that GIMP uses the color picker effect.

Will look into it.
Comment 7 Vlad Zahorodnii 2019-05-06 09:21:27 UTC
GIMP spews warnings like this

(gimp:23528): GLib-CRITICAL **: 12:00:48.423: the GVariant format string '(u)' has a type of '(u)' but the given value has a type of '((u))'

It looks very fishy because the return value has type of (u). In either case, it looks like a GIMP issue. Can you file corresponding bug report? https://gitlab.gnome.org/GNOME/gimp/issues/
Comment 8 Yevhen Popok 2019-05-06 09:37:16 UTC
(In reply to Vlad Zagorodniy from comment #7)
> GIMP spews warnings like this
> 
> (gimp:23528): GLib-CRITICAL **: 12:00:48.423: the GVariant format string
> '(u)' has a type of '(u)' but the given value has a type of '((u))'
> 
> It looks very fishy because the return value has type of (u). In either
> case, it looks like a GIMP issue. Can you file corresponding bug report?
> https://gitlab.gnome.org/GNOME/gimp/issues/
Sorry, I don't understand meaning of that warning.
Situation is that probably all X11 compositors except KWin support GIMP.
I can file bug report and they may say it's a KWin problem.
Comment 9 Vlad Zahorodnii 2019-05-06 10:00:25 UTC
> Sorry, I don't understand meaning of that warning.
It means that GIMP can't unpack color information sent by KWin.

> I can file bug report and they may say it's a KWin problem.
I doubt that this is a KWin problem.
Comment 10 David Edmundson 2019-05-06 10:20:12 UTC
@evgen

Link it here afterwards, I'll help follow it up.

>It looks very fishy because the return value has type of (u).

Our first out argument is (u), but the full message is a structure of all out arguments.
Comment 11 Yevhen Popok 2019-05-07 04:45:20 UTC
(In reply to Evgen from comment #8)
> (In reply to Vlad Zagorodniy from comment #7)
> > GIMP spews warnings like this
> > 
> > (gimp:23528): GLib-CRITICAL **: 12:00:48.423: the GVariant format string
> > '(u)' has a type of '(u)' but the given value has a type of '((u))'
> > 
> > It looks very fishy because the return value has type of (u). In either
> > case, it looks like a GIMP issue. Can you file corresponding bug report?
> > https://gitlab.gnome.org/GNOME/gimp/issues/
> Sorry, I don't understand meaning of that warning.
> Situation is that probably all X11 compositors except KWin support GIMP.
> I can file bug report and they may say it's a KWin problem.
This bug has already been reported (sadly, unnoticed)
https://gitlab.gnome.org/GNOME/gimp/issues/1878
Comment 12 Jehan 2019-05-07 09:41:28 UTC
This was implemented (commit 06bbf3e4, December 8, 2017) based on how the original "pick" method was implemented. Back then, it looks like only a QColor value was returned: https://phabricator.kde.org/D3480

It looks like you may have changed the API, haven't you? If so, I hope you don't plan to do this regularly. I really expect dbus API to be as stable as possible.

Also do you have documentation? I could not find any with a quick search.

Also if some of you guys wishes to propose a patch (code is in `libgimpwidgets/gimppickbutton-kwin.c` in our tree), you are more than welcome! This would be very helpful.
Comment 13 Vlad Zahorodnii 2019-05-07 09:53:15 UTC
(In reply to Jehan from comment #12)
> It looks like you may have changed the API, haven't you? If so, I hope you
> don't plan to do this regularly. I really expect dbus API to be as stable as
> possible.
Not really, the color picker wasn't touched in a while. The last commit dates back to 3/6/2017.

> Also do you have documentation? I could not find any with a quick search.
D-Bus introspection stuff is the only documentation as far as I know. We probably have to document most of our dbus APIs.