Commit c9ca9dac authored by Bhushan Shah's avatar Bhushan Shah 📱

Update Screenshot dbus interface

Also mark shouldReturnNativeSize to true since we want to get correctly
scaled screenshot.
parent 6168813d
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.kde.kwin.Screenshot">
<signal name="screenshotCreated">
<arg name="handle" type="t" direction="out"/>
</signal>
<method name="screenshotForWindow">
<arg name="winid" type="t" direction="in"/>
<arg name="mask" type="i" direction="in"/>
</method>
<method name="screenshotForWindow">
<arg name="winid" type="t" direction="in"/>
</method>
<method name="interactive">
<arg type="s" direction="out"/>
<arg name="mask" type="i" direction="in"/>
</method>
<method name="interactive">
<arg type="s" direction="out"/>
</method>
<method name="interactive">
<arg name="fd" type="h" direction="in"/>
<arg name="mask" type="i" direction="in"/>
</method>
<method name="interactive">
<arg name="fd" type="h" direction="in"/>
</method>
<method name="screenshotWindowUnderCursor">
<arg name="mask" type="i" direction="in"/>
</method>
<method name="screenshotWindowUnderCursor">
</method>
<method name="screenshotFullscreen">
<arg type="s" direction="out"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotFullscreen">
<arg type="s" direction="out"/>
</method>
<method name="screenshotFullscreen">
<arg name="fd" type="h" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotFullscreen">
<arg name="fd" type="h" direction="in"/>
</method>
<method name="screenshotScreen">
<arg type="s" direction="out"/>
<arg name="screen" type="i" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotScreen">
<arg type="s" direction="out"/>
<arg name="screen" type="i" direction="in"/>
</method>
<method name="screenshotScreen">
<arg name="fd" type="h" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotScreen">
<arg name="fd" type="h" direction="in"/>
</method>
<method name="screenshotArea">
<arg type="s" direction="out"/>
<arg name="x" type="i" direction="in"/>
<arg name="y" type="i" direction="in"/>
<arg name="width" type="i" direction="in"/>
<arg name="height" type="i" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotArea">
<arg type="s" direction="out"/>
<arg name="x" type="i" direction="in"/>
<arg name="y" type="i" direction="in"/>
<arg name="width" type="i" direction="in"/>
<arg name="height" type="i" direction="in"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg name="values" type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
</method>
<signal name="PropertiesChanged">
<arg name="interface_name" type="s" direction="out"/>
<arg name="changed_properties" type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
<arg name="invalidated_properties" type="as" direction="out"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="xml_data" type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg name="machine_uuid" type="s" direction="out"/>
</method>
</interface>
</node>
<interface name="org.kde.kwin.Screenshot">
<signal name="screenshotCreated">
<arg name="handle" type="t" direction="out"/>
</signal>
<method name="screenshotForWindow">
<arg name="winid" type="t" direction="in"/>
<arg name="mask" type="i" direction="in"/>
</method>
<method name="screenshotForWindow">
<arg name="winid" type="t" direction="in"/>
</method>
<method name="interactive">
<arg type="s" direction="out"/>
<arg name="mask" type="i" direction="in"/>
</method>
<method name="interactive">
<arg type="s" direction="out"/>
</method>
<method name="interactive">
<arg name="fd" type="h" direction="in"/>
<arg name="mask" type="i" direction="in"/>
</method>
<method name="interactive">
<arg name="fd" type="h" direction="in"/>
</method>
<method name="screenshotWindowUnderCursor">
<arg name="mask" type="i" direction="in"/>
</method>
<method name="screenshotWindowUnderCursor">
</method>
<method name="screenshotFullscreen">
<arg type="s" direction="out"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotFullscreen">
<arg type="s" direction="out"/>
</method>
<method name="screenshotFullscreen">
<arg name="fd" type="h" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/>
<arg name="shouldReturnNativeSize" type="b" direction="in"/>
</method>
<method name="screenshotFullscreen">
<arg name="fd" type="h" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotFullscreen">
<arg name="fd" type="h" direction="in"/>
</method>
<method name="screenshotScreen">
<arg type="s" direction="out"/>
<arg name="screen" type="i" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotScreen">
<arg type="s" direction="out"/>
<arg name="screen" type="i" direction="in"/>
</method>
<method name="screenshotScreen">
<arg name="fd" type="h" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotScreen">
<arg name="fd" type="h" direction="in"/>
</method>
<method name="screenshotArea">
<arg type="s" direction="out"/>
<arg name="x" type="i" direction="in"/>
<arg name="y" type="i" direction="in"/>
<arg name="width" type="i" direction="in"/>
<arg name="height" type="i" direction="in"/>
<arg name="captureCursor" type="b" direction="in"/>
</method>
<method name="screenshotArea">
<arg type="s" direction="out"/>
<arg name="x" type="i" direction="in"/>
<arg name="y" type="i" direction="in"/>
<arg name="width" type="i" direction="in"/>
<arg name="height" type="i" direction="in"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg name="values" type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
</method>
<signal name="PropertiesChanged">
<arg name="interface_name" type="s" direction="out"/>
<arg name="changed_properties" type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/>
<arg name="invalidated_properties" type="as" direction="out"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg name="xml_data" type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping"/>
<method name="GetMachineId">
<arg name="machine_uuid" type="s" direction="out"/>
</method>
</interface>
</node>
......@@ -86,7 +86,7 @@ PhonePanel::~PhonePanel() = default;
void PhonePanel::executeCommand(const QString &command)
{
qWarning() << "Executing" << command;
QProcess::startDetached(command);
QProcess::startDetached(command, QStringList());
  • Are you sure this is correct? I assume that the second argument is for arguments to pass to the executable, but doesn't our command already contain those in case of plasma-settings -m calls?

  • You are correct, if there's more than just an executable you can use KShell::splitArgs().

  • Which should nowadays be preferred? QProcess::splitCommand or KShell::splitArgs?

Please register or sign in to reply
}
void PhonePanel::toggleTorch()
......@@ -169,7 +169,7 @@ void PhonePanel::takeScreenshot()
return;
}
// 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);
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [](QDBusPendingCallWatcher* watcher) {
if (watcher->isError()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment