Bug 387720 - GDBus.Error:org.kde.kwin.ColorPicker.Error.Cancelled: Color picking got cancelled
Summary: GDBus.Error:org.kde.kwin.ColorPicker.Error.Cancelled: Color picking got cance...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Unclassified
Component: platform-x11-standalone (show other bugs)
Version: 5.11.5
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL: https://phabricator.kde.org/D10302
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-08 22:21 UTC by Jehan
Modified: 2018-02-05 20:21 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.12.1
mgraesslin: Wayland-
mgraesslin: X11+
mgraesslin: ReviewRequest+


Attachments
Error happens with running the dbus API through d-feet as well. (143.18 KB, image/png)
2017-12-08 22:21 UTC, Jehan
Details
Image of error (70.40 KB, image/png)
2018-02-03 22:34 UTC, Ankush Patel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jehan 2017-12-08 22:21:33 UTC
Created attachment 109264 [details]
Error happens with running the dbus API through d-feet as well.

Default @kde-desktop on Fedora 27, version 5.10.5 (not available in your list).
kwin-5.10.5-2.fc27.x86_64
plasma-desktop-5.10.5-1.fc27.x86_64

I am implementing color-picking on KDE for GIMP, with your API so that it works also on KDE/Wayland.
Unfortunately calling the new "pick" method (https://phabricator.kde.org/D3480), I constantly get the following error:

> GDBus.Error:org.kde.kwin.ColorPicker.Error.Cancelled: Color picking got cancelled

I would assume there is a bug in code too, but since that's a very simple dbus call with no arguments, I don't see where I could make a mistake. Also the error happens if I run the call with the d-feet application as well (see screenshot).
Comment 1 Martin Flöser 2017-12-09 20:36:30 UTC
I just installed d-feet and gave it a try: works fine.

Possibilities I see is a setup error in Fedora or a bug in the version (5.10 is no longer maintained, that's also the reason why it's not in the list).

Reasons for the canceled message are:
 * right click
 * Escape beint pressed
Comment 2 Jehan 2017-12-09 20:52:50 UTC
(In reply to Martin Flöser from comment #1)
> I just installed d-feet and gave it a try: works fine.
> 
> Possibilities I see is a setup error in Fedora or a bug in the version (5.10
> is no longer maintained, that's also the reason why it's not in the list).
> 
> Reasons for the canceled message are:
>  * right click
>  * Escape beint pressed

Hmm… well I won't be able to make the time to build an updated version of kwin/plasma. I guess I will just assume my implementation is fine or wait for Fedora to update their package to test again.
Comment 3 Ankush Patel 2018-02-03 22:34:57 UTC
Created attachment 110321 [details]
Image of error
Comment 4 Ankush Patel 2018-02-03 22:36:28 UTC
Comment on attachment 110321 [details]
Image of error

The bug is reproducible on KDE version 5.11.5.
Comment 5 Jehan 2018-02-03 22:49:42 UTC
Thanks Ankush. Updating the version field now that someone reproduced this on a maintained version of KDE. :-)
Comment 6 Martin Flöser 2018-02-04 14:06:56 UTC
I just installed d-feet on my other system and tried there. I'm not able to reproduce, d-feet does not print the cancel warning.

My steps:
1. open d-feet
2. select session bus
3. filter for KWin
4. select /ColorPicker -> pick
5. click execute
6. Now cursor becomes a cross and a message pops up
7. I click somewhere
8. d-feet prints the result.

Are there any steps I do in a different way?
Comment 7 Jehan 2018-02-04 14:21:53 UTC
For my own, that's the same steps, except I don't have your steps 6 to 8. After clicking "Execute", I just get the error directly.

Also I would like to note that we are using the API under KDE/X11, not Wayland (both Ankush Patel and I; he first reported the issue on GIMP: https://bugzilla.gnome.org/show_bug.cgi?id=793133). I realize I never said so because the ultimate goal was to have support for Wayland. But we still use the API, even on X11, as priority color-picking method when available.

Are you testing on KDE/Wayland or X11?
Comment 8 Jehan 2018-02-04 14:23:46 UTC
P.S.: and I have not tried under KDE/Wayland because Fedora does not propose me the option from the packaged KDE and I can't make the time to build KDE from scratch. So that's all I can help for now!
Comment 9 Martin Flöser 2018-02-04 15:11:26 UTC
Very likely that is the reason: I'm testing on Wayland. On X11 it needs to grab the pointer and keyboard. Maybe that is failing.
Comment 10 Jehan 2018-02-04 15:21:54 UTC
(In reply to Martin Flöser from comment #9)
> Very likely that is the reason: I'm testing on Wayland. On X11 it needs to
> grab the pointer and keyboard. Maybe that is failing.

Ok. Well ideally this would be fixed so that it works both on X11 and Wayland.

As a workaround, you could just disable the API on X11. If it is unavailable, GIMP will directly go to the X11 screenshot implementation and at least not throw errors.

Basically if the API is shown as available, it should work. ;-)
Comment 11 Martin Flöser 2018-02-04 16:07:48 UTC
I just digged into the source and it looks like someone forgot to implement this on X11.
Comment 12 Martin Flöser 2018-02-04 16:26:09 UTC
And reproduced on X11
Comment 13 Martin Flöser 2018-02-04 17:05:52 UTC
Patch at: https://phabricator.kde.org/D10302
Comment 14 Martin Flöser 2018-02-05 20:21:59 UTC
Git commit ea5e70116456975b3ca3f379777b8a83291bb4e8 by Martin Flöser.
Committed on 05/02/2018 at 20:21.
Pushed by graesslin into branch 'Plasma/5.12'.

[x11] Fix interactive point selection

Summary:
The support for interactive point selection was missing. This results in
the ColorPicker dbus API always returning an error on X11. We either need
to disable the ColorPicker on X11 or add support for this functionality.

As the X11 platform basically supports selecting a point in the
interactive window selection it makes more sense to add this missing
method in the platform than to disable support of color picker effect.
FIXED-IN: 5.12.1

Test Plan:
Run KWin/X11 on Xephyr and was able to pick a color and
kill a window

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10302

M  +55   -13   plugins/platforms/x11/standalone/windowselector.cpp
M  +6    -0    plugins/platforms/x11/standalone/windowselector.h
M  +8    -0    plugins/platforms/x11/standalone/x11_platform.cpp
M  +1    -0    plugins/platforms/x11/standalone/x11_platform.h

https://commits.kde.org/kwin/ea5e70116456975b3ca3f379777b8a83291bb4e8