Help with screenshot API.
rahul vadhyar
vadhyarrahul at gmail.com
Fri Oct 4 17:02:33 BST 2024
After trying copying code in xdg-desktop-portal-kde, I am now presented
with
The process is not authorized to take a screenshot
From my research(https://phabricator.kde.org/D29407,
https://forum.kde.org/viewtopic.php%3Ff=305&t=176422.html), it should have
been fixed by putting the app in a root write only dir. But even after
putting the app in /usr/bin and the .desktop file in
/usr/share/applications, I still cannot get rid of this error.
I am providing my .desktop file as reference if that helps.
[Desktop Entry]
Name=Kool Intelligence
Exec=koolintelligence
Icon=kde
Type=Application
Terminal=false
Categories=System
X-DBUS-ServiceName=org.kde.koolintelligence
X-KDE-DBUS-Restricted-Interfaces=org.kde.kwin.Screenshot,org.kde.KWin.ScreenShot2
Sorry for asking every small thing, I am new to this, and the lack of
documentation around this leaves me no option.
Please help me solve this (hopefully) final error.
A very heartfelt thanks for your support,
Rahul
On Fri, 4 Oct 2024 at 20:20, Vlad Zahorodnii <vlad.zahorodnii at kde.org>
wrote:
> On 10/4/24 5:28 PM, rahul vadhyar wrote:
> > Even if CaptureWorkspace returns a dictionary, I shouldn't be getting
> > the error that the API doesn't exist.
>
> I think that the error message is rather misleading. CaptureWorkspace
> expects some input arguments, but the example code provides none so
> QtDBus says that there's no CaptureWorkspace **with the specified**
> signature.
>
> CaptureWorkspace expects two arguments: a dictionary with various
> options (it can be empty), and a pipe file descriptor where kwin will
> write screenshot to. A good example how to use that API is spectacle or
> xdg-desktop-portal-kde
>
> https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/30b9ac6a169ee9f7c36aabbec4038a8a715ac2cb/src/screenshotdialog.cpp#L158
>
> > To provide more context, I am making a kirigami app. I am using the
> > .desktop file as given in the previous email. I am also using the
> > following command for compiling and testing
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20241004/e7744376/attachment-0001.htm>
More information about the kwin
mailing list