Switch off compositing, then try to capture the active window (either via option in Spectacle, or via Meta+Print shortcut). It will fail as soon as the active window touches the left/bottom/right screen border or extends beyond (top).
It works with compositing enabled.
If it sounds weird, it is…
*** Bug 384585 has been marked as a duplicate of this bug. ***
Hmm, I taking screenshots all the time using Active Window mode when the window is touching a screen edge in a VM with compositing disabled. Never tried putting it beyond the window borders though.
Never mind, my VM composits! Who knew? Can confirm the issue.
Thanks for testing ;)
Telling whether compositing is off should be easy, because there are no shadows… Also, make sure to test once in a while in this mode, because especially the performance might be totally different (e.g. moving windows, moving region capture in Spectacle etc.).
It fails whenever the coordinates of the window are out of bounds of the screen. This already happens when it touches a border since the window decoration would be outside the screen and xcb_image_get returns a null pixmap; the coordinates need to be clamped to the screen area.
Thanks for the insight. There is a patch in https://phabricator.kde.org/D10672 (sadly no automatic linking…), is that what you mean?
Haha, cool, that was virtually the same patch I was just about to write now. Thanks you saved me from doing so ;)
Cool ;) If you want to write more patches, I'd like to plug Bug 372408…
on my Arch Linux meta+print does not work when compositing is off (it works again after re-enable compositing).
Spectable capture an empty "screenshot" when I try capture an active window that is touching a screen border.
*** Bug 378621 has been marked as a duplicate of this bug. ***
Now I see: the reason why I was never able to reproduce this is because I turn window borders off, so there was never any content out of bounds.
(In reply to Henrik Fehlauer from comment #9)
> Cool ;) If you want to write more patches, I'd like to plug Bug 372408…
That would be quite the crowd pleaser. I've looked into this several times but it's a bit beyond my current skill level.
Git commit 5d2e20ce7e4c19fbd7227ab750ea6b31c9f8968a by Henrik Fehlauer, on behalf of Alex Nemeth.
Committed on 06/03/2018 at 20:29.
Pushed by rkflx into branch 'master'.
Set screen bounds for active window grab when compositor is disabled
It failed to capture the window area when the window was outside of the screen and showed a null image to the user when compositor was not enabled.
Now it only captures the area that is on the screen.
Reviewers: #spectacle, rkflx, ngraham, broulik
Reviewed By: #spectacle, rkflx, ngraham
Subscribers: davidedmundson, broulik, ngraham
Differential Revision: https://phabricator.kde.org/D10672
M +9 -0 src/PlatformBackends/X11ImageGrabber.cpp