Review Request 129176: Refactor pixmap grabbing, add robustness

Peter Wu peter at lekensteyn.nl
Fri Oct 14 09:09:39 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129176/
-----------------------------------------------------------

(Updated Oct. 14, 2016, 11:09 a.m.)


Status
------

This change has been marked as submitted.


Review request for KDE Graphics and Boudhayan Gupta.


Changes
-------

Submitted with commit 7a5603fda8f1e591d31dba1ad178c44ad6847cc2 by Peter Wu to branch master.


Bugs: 370303
    https://bugs.kde.org/show_bug.cgi?id=370303


Repository: spectacle


Description
-------

Do not go in an infinite loop when the root window cannot be captured
(bug 370303). Avoid crashing xcb_image_destroy by checking for NULL.

Split the getWindowPixmap into three logical methods depending on the
consumer: obtaining a pixmap from KWin, obtaining a pixmap from a single
window and obtaining a pixmap from a full screen. This enables some
optimizations, like obtaining a smaller area of the screen without
cropping. Additionally, it will make fixing HiDPI support easier.

Added robustness: if KWin somehow fails, now it will fallback to a
fullscreen capture instead of an null pixmap.

BUG: 370303


Diffs
-----

  src/PlatformBackends/X11ImageGrabber.h ee3299907a09ef7ee397851f2686f113daf1e830 
  src/PlatformBackends/X11ImageGrabber.cpp c1d949954b9a99a2648002a05e0fd00fa158eca8 

Diff: https://git.reviewboard.kde.org/r/129176/diff/


Testing
-------

Tried all options, with/with decoration/cursor. Picture is still grabbed correctly.
Made isKwinAvailable return false to try the fallback path.

The linked bug is fixed as side-effect, now it does not crash anymore in Weston/XWayland, but the picture is still empty.


Thanks,

Peter Wu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-graphics-devel/attachments/20161014/568c1c39/attachment.html>


More information about the Kde-graphics-devel mailing list