Bug 1100765 - gimp create from screenshot "Select a region to grab" is missing in Plasma, and taking a screenshot gives an error when compositing is off
gimp create from screenshot "Select a region to grab" is missing in Plasma, a...
Status: NEW
: 1135853 (view as bug list)
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: X11 Applications
Current
Other Other
: P5 - None : Normal with 1 vote (vote)
: ---
Assigned To: Michael Gorse
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-07-10 15:05 UTC by Philippe Condé
Modified: 2021-09-23 17:06 UTC (History)
7 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
gimp in english with 3 options (33.52 KB, image/png)
2018-07-10 15:05 UTC, Philippe Condé
Details
gimp in french with only two options (24.33 KB, image/png)
2018-07-10 15:06 UTC, Philippe Condé
Details
error when selecting create from one window (12.67 KB, image/png)
2018-07-10 15:07 UTC, Philippe Condé
Details
output asked (7.28 KB, text/plain)
2018-09-04 19:08 UTC, Philippe Condé
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Condé 2018-07-10 15:05:32 UTC
Created attachment 776591 [details]
gimp in english  with 3 options

Hello,

in gimp  select create image ==> from screenshot
in Enclish you have 3 options (see attachment gimp_englishok.png)
- take a screenshot of a single window
- take screenshot of entire screen
- select a region to grab

in french the third option is missing (see attachment gimp_frenchbad.png)

if I select in french one of the two available options I receive an error
(see attachment  gimp_error.png 
Erreur d’exécution « Capture d’écran » :
GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/Screenshot'
Comment 1 Philippe Condé 2018-07-10 15:06:12 UTC
Created attachment 776593 [details]
gimp in french with only two options
Comment 2 Philippe Condé 2018-07-10 15:07:13 UTC
Created attachment 776595 [details]
error when selecting create from one window
Comment 3 Philippe Condé 2018-07-17 17:14:42 UTC
I have done some testing and I found these differences
If I start gimp  from a user Konsole with $ LANG=C gimp
then in the option file ==> create ==> screenshot I have only 2 options
1) Take a screenshot of a single window
2) Take a screenshot from  the entire screen

if I start gimp from a super user Konsole then I have 3 options
1) Take a screenshot of a single window
2) Take a screenshot from  the entire screen
3) Select a region to grab

I removed the ~/.config/GIMP  library for my normal user and forced the reinstallation of all GIMP Packages but the differences remain the same.

The version installed is
~> rpm -qa gimp
gimp-2.10.2-1.2.x86_64

many thanks in advance
Philippe
Comment 4 Philippe Condé 2018-09-02 19:07:30 UTC
Hello,

after some testing i can confirm the following
the option create new image ==> from Screenshot ==> select a region to grab.

1. Calling gimp from a normal user doesn't show the option select a region to grab

2 .Calling gimp from a root (super user konsole) shows the option select a region to grab.

see also discussion in https://forums.opensuse.org/showthread.php/532907-gimp-create-image-from-screenshot

- Work with Tumbleweed GNOME and x11.
- work with xfce 

Maybe related to KDE Plasma? 

Many thanks in advance
Philippe
Comment 5 Felix Miata 2018-09-02 23:00:49 UTC
KDE/Plasma now has a screenshot tool named "Spectacle". Previously it was named KSnapshot. I take the screenshot with KSnapshot or Spectacle, and from that image use Gimp to select and manipulate the region of interest. Maybe Spectacle is designed to usurp the screenshot function from other apps running in a Plasma session that can othewise take a screenshot?
Comment 6 Christophe Giboudeaux 2018-09-03 09:19:18 UTC
(In reply to Felix Miata from comment #5)
> KDE/Plasma now has a screenshot tool named "Spectacle". Previously it was
> named KSnapshot. I take the screenshot with KSnapshot or Spectacle, and from
> that image use Gimp to select and manipulate the region of interest. Maybe
> Spectacle is designed to usurp the screenshot function from other apps
> running in a Plasma session that can othewise take a screenshot?

That can be tested easily after uninstalling spectacle.

<spoiler>It's unrelated</spoiler>
Comment 7 Christophe Giboudeaux 2018-09-03 09:26:07 UTC
Tested when using both english & french, no change. 
Can you confirm you see the region grab option if you run "dbus-launch gimp" ?
Comment 8 Philippe Condé 2018-09-03 18:58:14 UTC
hello,

using "dbus-launch gimp" with a normal user shows the option "select  region to grbp" and it is working. 

Regards
Philippe
Comment 9 Fabian Vogt 2018-09-04 07:29:03 UTC
Which display manager do you use?

Please run "qdbus-qt5", "qdbus-qt5 org.kde.KWin" and "qdbus-qt5 org.kde.KWin /Screenshot", "env" and upload the output.
Comment 10 Philippe Condé 2018-09-04 19:08:20 UTC
Created attachment 781915 [details]
output  asked
Comment 11 Philippe Condé 2018-09-04 19:09:58 UTC
hello 

I use Kde plasma.

I have linked a file with the output of the different commands 

Regards
Philippe
Comment 12 . . 2019-03-26 05:58:23 UTC
If I start gimp from the KDE menu, I also get the error (see below)
when using gimp File > Create > Screenshot > Snap:

Error:
....
execution error for 'screenshot' gdbus.error:org.freedesktop.dbus.error.unknownobject
no such path '/screenshot'
....

I do not get the error if I start gimp from the command line using:

From the command line:
....
dbus-launch gimp-2.10
....

When running qdbus-qt5 org.kde.KWin /Screenshot:
....
Error: org.freedesktop.DBus.Error.UnknownObject
No such object path '/Screenshot'
....

The third menu option on the Screenshot window, "Select a region to grab", is
also missing.

If you work a lot in gimp, the screenshot feature is really convenient, as is
the xsane option which also appears under File > Create. All multimedia, if you
will, in one spot.

Tumbleweed: 20190322
Gimp: 2.10.8
Comment 13 Wolfgang Bauer 2019-03-26 09:08:31 UTC
(In reply to . . from comment #12)
> When running qdbus-qt5 org.kde.KWin /Screenshot:
> ....
> Error: org.freedesktop.DBus.Error.UnknownObject
> No such object path '/Screenshot'
> ....

Is compositing disabled? Does it help if you enable it?

Compositing is mandatory for kwin's screenshot interface to work, as otherwise kwin has no idea about the windows' contents.
Comment 14 . . 2019-03-28 05:51:29 UTC
Okay.

Bottom line: File > Create > Screenshot... > Snap does work if compositing is on.

Command (1) initially showed false. The only way I could find to turn compositing on the first time was to go to System Settings > Display and Montor > Compositor and check "Enable compositor on startup". Repeating command (1) then returned true. Did a screenshot from gimp of another window and it worked. No error messagebox.

Command (2), to suspend and resume compositing, worked as expected with gimp and screenshots.

Once compositing was active, command (3) showed the /Screenshot path that was mentioned in the error message.

Haven't used compositing/Desktop effects in the past. It doesn't seem to make a difference to Spectacle whether compositing is active or not, just to gimp. 

Starting gimp with dbus-launch also worked without the compositing requirement.

Regarding the 3rd menu option, "Select a region to grab":

- If I start gimp from the menu (compositing on or off), the 3rd menu option IS NOT there.
- If I start gimp from the command line using dbus-launch (compositing on or off), the 3rd menu option IS there.


Commands
--------
 
(1): 
qdbus-qt5 org.kde.KWin /Compositor active 

(2):
qdbus-qt5 org.kde.KWin /Compositor suspend  - gimp screen error
qdbus-qt5 org.kde.KWin /Compositor resume   - gimp screen worked

(3):
qdbus-qt5 org.kde.KWin
Comment 15 Wolfgang Bauer 2019-03-28 12:39:14 UTC
(In reply to . . from comment #14)
> Haven't used compositing/Desktop effects in the past. It doesn't seem to
> make a difference to Spectacle whether compositing is active or not

It does make a difference.
With compositing active, spectacle asks kwin for the screenshot, while with compositing off it grabs the screen content directly.

The most obvious result of the latter is that hidden parts of a window are missing.
And there are also problems/bugs in the latter method:
https://bugs.kde.org/show_bug.cgi?id=390787

Obviously, gimp tries to get the screenshot from kwin too (via DBus) if possible.

> Regarding the 3rd menu option, "Select a region to grab":
> 
> - If I start gimp from the menu (compositing on or off), the 3rd menu option
> IS NOT there.
> - If I start gimp from the command line using dbus-launch (compositing on or
> off), the 3rd menu option IS there.

For the record, the 3rd menu option ("Select a region to grab") is always there (and works) in gimp 2.8 on my Leap 15.0 system (I don't use Tumbleweed), regardless whether compositing is on/off or whether I start it from the application menu or command line (even without dbus-launch).
I also don't get any error message when compositing is off (although org.kde.KWin/Screenshot doesn't exist then of course).

So there seems to be a "regression" (or maybe intentional change) in gimp 2.10 in that it requires compositing now (when run in Plasma at least).

But TBH, I don't see how the option missing with compositing on can be a Plasma problem, especially if it also happens when running it from the command line (without dbus-launch). Apparently it cannot connect to the DBus user session in your cases for some reason.

What language are *you* using?
The original report states that the problem only occurs with French (LANG=fr_BE.UTF-8) and not English, though I don't really see how that would make a difference. (and I did try running gimp 2.8 with LANG=fr_BE.UTF-8 too)

I suppose modifying the menu entry to use "dbus-launch" could be a workaround for you though.
Comment 16 Wolfgang Bauer 2019-03-28 12:59:52 UTC
Btw, I found a similar Debian bug report (about the "GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object
path '/Screenshot'"):
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=915110

In that case the language/locale is cs_CZ...
Comment 17 . . 2019-03-29 19:18:29 UTC
You are right this is probably a gimp bug appearing in all distributions when
a user has a kde desktop, kwin_x11 window manger, and compositing off.

I am not able to confirm, but speculate that when starting gimp with
dbus-launch, gimp plug-in may be falling back to the old way of doing things
which still works.

Lots of discussion on the topic of gimp working on other desktops, like:

"In order to keep gnome-screenshot working with other window managers,
this keeps the old, X11 based area selection code around as a fallback
when the DBus interface is unavailable."
https://gitlab.gnome.org/GNOME/gnome-screenshot/commit/56065725542e36bdde6acd66b8b071fbd0b08e6f

There's a TODO comment in
https://gitlab.gnome.org/GNOME/gimp/blob/master/plug-ins/screenshot/screenshot-kwin.c
that says: "The KDE API has "screenshotArea" method but no method to get
coordinates could be found." Which might explain why the third option is not
there.

I attempted to use dbus-monitor, but you need to know a lot more about kde, dbus
and how gimp
Comment 18 Wolfgang Bauer 2019-03-29 19:41:21 UTC
So we probably should reassign this bug report, or close it as upstream?

Btw, I think the reason why it works when using dbus-launch is that it uses its own new DBus session bus then (created by dbus-launch), where the already running kwin doesn't show up at all...
I suppose you would run into same problem if you do a sequence like this:
export `dbus-launch`
kwin5_x11 --replace
gimp

whereas it should work with:
export `dbus-launch`
gimp

Just guessing though, as I wrote I still have gimp 2.8 which doesn't seem to have this issue. (maybe it doesn't have "KDE/kwin support code" yet...)
Comment 19 Wolfgang Bauer 2019-03-29 19:57:04 UTC
(In reply to Wolfgang Bauer from comment #18)
> I suppose you would run into same problem if you do a sequence like this:
> export `dbus-launch`
> kwin5_x11 --replace
> gimp

That should be kwin_x11 --replace of course, not kwin5_x11.
Comment 20 Wolfgang Bauer 2019-04-05 08:10:41 UTC
Ok, I tried on a Tumbleweed LiveCD now and can easily reproduce the problems.
It's clearly not related to the language.

So to summarize again:
Gimp apparently uses some kwin specific support code for screenshots if it detects org.kde.KWin on the DBus session bus.

And this has two issues:

1) If compositing is turned off, taking a screenshot just gives an error message "GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/Screenshot'"

The reason is that kwin's /Screenshot interface doesn't exist when compositing is turned off.
Gimp should rather use the generic fallback code in that case.

2) The option "Select a region to grab" is missing.

Apparently that's not implemented/supported (yet?) in gimp's kwin support code.
It could also be done by using the fallback code I assume.
(that wouldn't work on Wayland though I think, maybe that's the reason for this specific kwin support in the first place)

These are "regressions" in gimp 2.10, both work as expected with gimp 2.8 in Leap 15.0 (maybe because it does use the fallback code and/or doesn't have specific support for kwin yet).

Both are clearly problems in gimp though and need to be fixed there.
As gimp is not a KDE application, I'll reassign this.
Although I think it would be a good idea to report it upstream to the gimp developers too.
Comment 21 Fabian Vogt 2019-04-05 08:20:46 UTC
Reassinging to gimp maintainer.
Comment 22 Wolfgang Bauer 2019-05-22 08:04:01 UTC
*** Bug 1135853 has been marked as a duplicate of this bug. ***
Comment 23 Heiko Brümmer 2021-09-23 17:06:06 UTC
With Leap 15.3 and Gimp 2.10.12, this bug is still present. 

Using KDE and no compositor yields into the error message:

Fehler beim Ausführen von »Bildschirmfoto «:
GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/Screenshot'

LANG is set to de_DE.UTF-8.