Add a shouldReturnNativeSize to screenshotFullscreen so that KWin can export
screenshot that are screen pixel accurate.
Useful for spectacle to be able to do rectangular selection kind of screenshot.
davidedmundson | |
bport | |
zzag | |
apol |
KWin |
Add a shouldReturnNativeSize to screenshotFullscreen so that KWin can export
screenshot that are screen pixel accurate.
Useful for spectacle to be able to do rectangular selection kind of screenshot.
Example of a top screen using a 1.25 scale ratio being export in native resolution
Example of the same screen in virtual resolution:
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
effects/screenshot/screenshot.h | ||
---|---|---|
104 | I think we could consider this interface public API and adding new arguments changes the DBus signature iirc. |
I think we could consider this interface public API and adding new arguments changes the DBus signature iirc.
Perhaps we should just add a new overload.
You're right that DBus would fail if you don't call with the right number of arguments to match a method signature, but you underestimate QtDBus. It's /amaaaazing/
It knows some arguments are defaults, for the existing code it currently generates:
<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>
In this case it'll just add a 3rd.
Though @meven can you just run qdbus org.kde.KWin /Screenshot org.freedesktop.DBus.Introspectable.Introspect and double check.
effects/screenshot/screenshot.cpp | ||
---|---|---|
408 | Please clear m_cacheOutputsImages so we're not wasting ram |
but you underestimate QtDBus
What if we have a third party non-Qt screenshot library using it :)
but you underestimate QtDBus
It's kwin (and therefore definitely QtDBus) doing the introspection generation
QtDbus is quite nice indeed, it added the new method assuming it will use defaults:
<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>
Still perhaps we should have a distinct dbus to make the API clearer.
AFAIK there is only one user currently : spectacle, that I am updating too anyway.
effects/screenshot/screenshot.cpp | ||
---|---|---|
408 | Done line 442 |