Update Screenshot dbus interface

Also mark shouldReturnNativeSize to true since we want to get correctly
scaled screenshot.
This commit is contained in:
Bhushan Shah 2020-10-19 20:50:31 +05:30
parent 6168813d13
commit c9ca9dac10
2 changed files with 119 additions and 113 deletions

View file

@ -1,114 +1,120 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node> <node>
<interface name="org.kde.kwin.Screenshot"> <interface name="org.kde.kwin.Screenshot">
<signal name="screenshotCreated"> <signal name="screenshotCreated">
<arg name="handle" type="t" direction="out"/> <arg name="handle" type="t" direction="out"/>
</signal> </signal>
<method name="screenshotForWindow"> <method name="screenshotForWindow">
<arg name="winid" type="t" direction="in"/> <arg name="winid" type="t" direction="in"/>
<arg name="mask" type="i" direction="in"/> <arg name="mask" type="i" direction="in"/>
</method> </method>
<method name="screenshotForWindow"> <method name="screenshotForWindow">
<arg name="winid" type="t" direction="in"/> <arg name="winid" type="t" direction="in"/>
</method> </method>
<method name="interactive"> <method name="interactive">
<arg type="s" direction="out"/> <arg type="s" direction="out"/>
<arg name="mask" type="i" direction="in"/> <arg name="mask" type="i" direction="in"/>
</method> </method>
<method name="interactive"> <method name="interactive">
<arg type="s" direction="out"/> <arg type="s" direction="out"/>
</method> </method>
<method name="interactive"> <method name="interactive">
<arg name="fd" type="h" direction="in"/> <arg name="fd" type="h" direction="in"/>
<arg name="mask" type="i" direction="in"/> <arg name="mask" type="i" direction="in"/>
</method> </method>
<method name="interactive"> <method name="interactive">
<arg name="fd" type="h" direction="in"/> <arg name="fd" type="h" direction="in"/>
</method> </method>
<method name="screenshotWindowUnderCursor"> <method name="screenshotWindowUnderCursor">
<arg name="mask" type="i" direction="in"/> <arg name="mask" type="i" direction="in"/>
</method> </method>
<method name="screenshotWindowUnderCursor"> <method name="screenshotWindowUnderCursor">
</method> </method>
<method name="screenshotFullscreen"> <method name="screenshotFullscreen">
<arg type="s" direction="out"/> <arg type="s" direction="out"/>
<arg name="captureCursor" type="b" direction="in"/> <arg name="captureCursor" type="b" direction="in"/>
</method> </method>
<method name="screenshotFullscreen"> <method name="screenshotFullscreen">
<arg type="s" direction="out"/> <arg type="s" direction="out"/>
</method> </method>
<method name="screenshotFullscreen"> <method name="screenshotFullscreen">
<arg name="fd" type="h" direction="in"/> <arg name="fd" type="h" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/> <arg name="captureCursor" type="b" direction="in"/>
</method> <arg name="shouldReturnNativeSize" type="b" direction="in"/>
<method name="screenshotFullscreen"> </method>
<arg name="fd" type="h" direction="in"/> <method name="screenshotFullscreen">
</method> <arg name="fd" type="h" direction="in"/>
<method name="screenshotScreen"> <arg name="captureCursor" type="b" direction="in"/>
<arg type="s" direction="out"/> </method>
<arg name="screen" type="i" direction="in"/> <method name="screenshotFullscreen">
<arg name="captureCursor" type="b" direction="in"/> <arg name="fd" type="h" direction="in"/>
</method> </method>
<method name="screenshotScreen"> <method name="screenshotScreen">
<arg type="s" direction="out"/> <arg type="s" direction="out"/>
<arg name="screen" type="i" direction="in"/> <arg name="screen" type="i" direction="in"/>
</method> <arg name="captureCursor" type="b" direction="in"/>
<method name="screenshotScreen"> </method>
<arg name="fd" type="h" direction="in"/> <method name="screenshotScreen">
<arg name="captureCursor" type="b" direction="in"/> <arg type="s" direction="out"/>
</method> <arg name="screen" type="i" direction="in"/>
<method name="screenshotScreen"> </method>
<arg name="fd" type="h" direction="in"/> <method name="screenshotScreen">
</method> <arg name="fd" type="h" direction="in"/>
<method name="screenshotArea"> <arg name="captureCursor" type="b" direction="in"/>
<arg type="s" direction="out"/> </method>
<arg name="x" type="i" direction="in"/> <method name="screenshotScreen">
<arg name="y" type="i" direction="in"/> <arg name="fd" type="h" direction="in"/>
<arg name="width" type="i" direction="in"/> </method>
<arg name="height" type="i" direction="in"/> <method name="screenshotArea">
<arg name="captureCursor" type="b" direction="in"/> <arg type="s" direction="out"/>
</method> <arg name="x" type="i" direction="in"/>
<method name="screenshotArea"> <arg name="y" type="i" direction="in"/>
<arg type="s" direction="out"/> <arg name="width" type="i" direction="in"/>
<arg name="x" type="i" direction="in"/> <arg name="height" type="i" direction="in"/>
<arg name="y" type="i" direction="in"/> <arg name="captureCursor" type="b" direction="in"/>
<arg name="width" type="i" direction="in"/> </method>
<arg name="height" type="i" direction="in"/> <method name="screenshotArea">
</method> <arg type="s" direction="out"/>
</interface> <arg name="x" type="i" direction="in"/>
<interface name="org.freedesktop.DBus.Properties"> <arg name="y" type="i" direction="in"/>
<method name="Get"> <arg name="width" type="i" direction="in"/>
<arg name="interface_name" type="s" direction="in"/> <arg name="height" type="i" direction="in"/>
<arg name="property_name" type="s" direction="in"/> </method>
<arg name="value" type="v" direction="out"/> </interface>
</method> <interface name="org.freedesktop.DBus.Properties">
<method name="Set"> <method name="Get">
<arg name="interface_name" type="s" direction="in"/> <arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/> <arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/> <arg name="value" type="v" direction="out"/>
</method> </method>
<method name="GetAll"> <method name="Set">
<arg name="interface_name" type="s" direction="in"/> <arg name="interface_name" type="s" direction="in"/>
<arg name="values" type="a{sv}" direction="out"/> <arg name="property_name" type="s" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/> <arg name="value" type="v" direction="in"/>
</method> </method>
<signal name="PropertiesChanged"> <method name="GetAll">
<arg name="interface_name" type="s" direction="out"/> <arg name="interface_name" type="s" direction="in"/>
<arg name="changed_properties" type="a{sv}" direction="out"/> <arg name="values" type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
<arg name="invalidated_properties" type="as" direction="out"/> </method>
</signal> <signal name="PropertiesChanged">
</interface> <arg name="interface_name" type="s" direction="out"/>
<interface name="org.freedesktop.DBus.Introspectable"> <arg name="changed_properties" type="a{sv}" direction="out"/>
<method name="Introspect"> <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
<arg name="xml_data" type="s" direction="out"/> <arg name="invalidated_properties" type="as" direction="out"/>
</method> </signal>
</interface> </interface>
<interface name="org.freedesktop.DBus.Peer"> <interface name="org.freedesktop.DBus.Introspectable">
<method name="Ping"/> <method name="Introspect">
<method name="GetMachineId"> <arg name="xml_data" type="s" direction="out"/>
<arg name="machine_uuid" type="s" direction="out"/> </method>
</method> </interface>
</interface> <interface name="org.freedesktop.DBus.Peer">
</node> <method name="Ping"/>
<method name="GetMachineId">
<arg name="machine_uuid" type="s" direction="out"/>
</method>
</interface>
</node>

View file

@ -86,7 +86,7 @@ PhonePanel::~PhonePanel() = default;
void PhonePanel::executeCommand(const QString &command) void PhonePanel::executeCommand(const QString &command)
{ {
qWarning() << "Executing" << command; qWarning() << "Executing" << command;
QProcess::startDetached(command); QProcess::startDetached(command, QStringList());
} }
void PhonePanel::toggleTorch() void PhonePanel::toggleTorch()
@ -169,7 +169,7 @@ void PhonePanel::takeScreenshot()
return; return;
} }
// Take fullscreen screenshot, and no pointer // Take fullscreen screenshot, and no pointer
QDBusPendingCall pcall = m_screenshotInterface->screenshotFullscreen(QDBusUnixFileDescriptor(lPipeFds[1]), false); QDBusPendingCall pcall = m_screenshotInterface->screenshotFullscreen(QDBusUnixFileDescriptor(lPipeFds[1]), false, true);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall, this);
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [](QDBusPendingCallWatcher* watcher) { QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [](QDBusPendingCallWatcher* watcher) {
if (watcher->isError()) { if (watcher->isError()) {