Refactor pixmap grabbing, add robustness

Authored by Lekensteyn on Oct 10 2016, 12:06 AM.

Description

Refactor pixmap grabbing, add robustness

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.

REVIEW: 129176
BUG: 370303
FIXED-IN: 16.12

Details

Committed
LekensteynOct 14 2016, 9:08 AM
Parents
R166:aab52c83ba70: Capture all windows for "Window under cursor"
Branches
Unknown
Tags
Unknown