Commit db2231ae authored by Alex Nemeth's avatar Alex Nemeth Committed by Nate Graham

Fix capturing QDialog that included the whole desktop area

Summary:
QDialog may add a 1x1 sized desktop window in the top left corner when capturing with Window Under Cursor.
Now it ignores that.

BUG: 376350

Test Plan:
Before:
{F5719291}

After:
{F5719290}

Reviewers: #spectacle, rkflx, ngraham

Reviewed By: #spectacle, rkflx, ngraham

Subscribers: ngraham

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D10673
parent 330e113d
......@@ -433,13 +433,20 @@ void X11ImageGrabber::grabTransientWithParent()
QSet<xcb_window_t> transients;
xcb_window_t parentWinId = curWin;
const QRect desktopRect(0, 0, 1, 1);
do {
// find parent window and add the window to the visible region
xcb_window_t winId = parentWinId;
QRect winRect;
parentWinId = getTransientWindowParent(winId, winRect);
transients << winId;
clipRegion += winRect;
// Don't include the 1x1 pixel sized desktop window in the top left corner that is present
// if the window is a QDialog without a parent.
// BUG: 376350
if (winRect != desktopRect) {
clipRegion += winRect;
}
// Continue walking only if this is a transient window (having a parent)
} while (parentWinId != XCB_WINDOW_NONE && !transients.contains(parentWinId));
......
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