Bug 387721 - "screenshotArea" dbus API needs a "selectArea" method or similar
Summary: "screenshotArea" dbus API needs a "selectArea" method or similar
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: effects-various (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-08 23:23 UTC by Jehan
Modified: 2023-05-11 08:56 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jehan 2017-12-08 23:23:31 UTC
I have implemented screenshot through KWin API in GIMP. It is working fine except for the rectangular area screenshot.

"org.kde.kwin.Screenshot" provides a "screenshotArea" method, but it requires to get coordinates. While this could be done in X11, in Wayland, this can only be done through an API.

Here is for instance GNOME API for screenshots: https://git.gnome.org/browse/gnome-shell/tree/data/org.gnome.Shell.Screenshot.xml
As you can see it provides a "SelectArea" method which allows to select a rectangular area interactively and returns coordinates and width/length.

Could KDE implement something similar?

It looks like you could also make good usage of it. In Spectacle code, I see that grabRectangularRegion() shows an "// unsupported", so I assume it doesn't work in your own screenshot application (untested, just assumption! :P):
https://cgit.kde.org/spectacle.git/tree/src/PlatformBackends/KWinWaylandImageGrabber.cpp

Anyway thanks!
Comment 1 Martin Flöser 2017-12-09 11:13:50 UTC
Yes, the area call is from X11 times and currently unsupported on Wayland. It would raise a dbus error.
Comment 2 Luc Lalonde 2019-09-26 15:00:22 UTC
Would this error message be related to this problem:

Execution error for 'Screenshot':
GDBus.Error:org.freedesktop.DBus.Error.UnknownObject: No such object path '/Screenshot'

Here's my version:

gimp-2.10.12-3.module_f30+6174+bc22f659.x86_64

I'm running X11... not Wayland.
Comment 3 Luc Lalonde 2019-09-26 15:03:28 UTC
If I launch Gimp using 'dbus-launch' I do not get this error.
Comment 4 David Edmundson 2023-05-11 08:56:43 UTC
For it to be useful, this needs to be in the xdg-portal. We will support all features there.