Using xdg-desktop-portal-kde to take screenshots
jgrulich at redhat.com
Mon Sep 21 07:08:27 BST 2020
ne 20. 9. 2020 v 18:37 odesílatel Damir Porobic <damir_porobic at live.com>
> Hello Jan,
> finally I found some time to upgrade my OS and got a newer Plasma Version
> but I'm still struggling with the Screenshot Portal.
> Here is my implementation, almost identical to yours from the test that
> you have linked me (pasting here only the relevant methods):I get the
> dialog which asks me what type of screenshot I want to take I select it, a
> small image is show in the dialog and I can click on save (which saves the
> image in my home directory) but the gotScreenshotResponse is never called.
> Any idea why?
I have no idea. The code looks good and identical to what I have in the
example. When you run "dbus-monitor --session" and you perform the
screenshot, do you see this signal to be called at all?
> Can I tell the dialog where to save those images?
Unfortunately no, I made it very basic, but patches are welcomed, it won't
be a hard task to implement it.
> Can I tell the dialog right away what type of screenshot I want to take?
Unfortunately no, this is not supported by the portal API.
> Can I just share the screenshot with my application without saving it?
Unfortunately no, again a limitation of the portal API as the portal is
supposed to return an URI. You can however directly use KWin DBus interface
to get a screenshot, specifying directly what type of screenshot you want
to tak and you get the raw image. This however will make it work only in
Plasma and will not work in an application running in sandbox without
giving it access to DBus.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the kde-devel