<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<blockquote style="border-left: 3px solid rgb(200, 200, 200); border-top-color: rgb(200, 200, 200); border-right-color: rgb(200, 200, 200); border-bottom-color: rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
When you run "dbus-monitor --session" and you perform the screenshot, do you see this signal to be called at all?<br>
</div>
</blockquote>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks Jan, I'll try that. </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<blockquote style="border-left: 3px solid rgb(200, 200, 200); border-top-color: rgb(200, 200, 200); border-right-color: rgb(200, 200, 200); border-bottom-color: rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, 102);">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; font-size: 14px; background-color: rgb(255, 255, 255); display: inline !important">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. </span></div>
</blockquote>
<div style=""><font color="#000000"><span style="font-size: 14px;">My Application already supports native Plasma and Gnome Wayland Screenshots, but that does don't work if the application is packaged as Snap or when non Plasma or Gnome environments are used,
so I'm trying to make this generic Wayland solution work.</span></font></div>
<div style=""><font color="#000000"><span style="font-size: 14px;"><br>
</span></font></div>
<div style=""><font color="#000000"><span style="font-size: 14px;">Also, I've been playing around with this under Gnome too and they have also a Dialog but with a Share button instead of Save. I believe they are doing it like with the native Wayland solution
by saving the image in a temp directory that is deleted on reboot and just providing the path to the image. The user can decide what to do with the image, save it permanently or do nothing and the image is gone. Though there I have the same problem that the gotScreenshotResponse
is never called. </span></font></div>
<div style=""><font color="#000000"><span style="font-size: 14px;"><br>
</span></font></div>
<div style=""><font color="#000000"><span style="font-size: 14px;">Best regards,</span></font></div>
<div style=""><font color="#000000"><span style="font-size: 14px;">Damir</span></font></div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> kde-devel <kde-devel-bounces@kde.org> on behalf of Jan Grulich <jgrulich@redhat.com><br>
<b>Sent:</b> Monday, September 21, 2020 08:08<br>
<b>To:</b> kde-devel@kde.org <kde-devel@kde.org><br>
<b>Subject:</b> Re: Using xdg-desktop-portal-kde to take screenshots</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">ne 20. 9. 2020 v 18:37 odesílatel Damir Porobic <<a href="mailto:damir_porobic@live.com">damir_porobic@live.com</a>> napsal:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hello Jan,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
finally I found some time to upgrade my OS and got a newer Plasma Version but I'm still struggling with the Screenshot Portal.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Here is my implementation, almost identical to yours from the test that you have linked me (pasting here only the relevant methods):<span style="font-size:12pt">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?</span></div>
</div>
</blockquote>
<div><br>
</div>
<div>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?</div>
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Can I tell the dialog where to save those images? </div>
</div>
</blockquote>
<div><br>
</div>
<div>Unfortunately no, I made it very basic, but patches are welcomed, it won't be a hard task to implement it.</div>
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Can I tell the dialog right away what type of screenshot I want to take?</div>
</div>
</blockquote>
<div><br>
</div>
<div>Unfortunately no, this is not supported by the portal API.</div>
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Can I just share the screenshot with my application without saving it? </div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="font-family:Arial,Helvetica,sans-serif; font-size:small; color:rgb(34,34,34)"></span></div>
</div>
</blockquote>
<div><br>
</div>
<div>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.</div>
<div> </div>
<div>Regards,</div>
<div>Jan</div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</body>
</html>