Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 5d2e20ce authored by Alex Nemeth's avatar Alex Nemeth Committed by Henrik Fehlauer

Set screen bounds for active window grab when compositor is disabled

Summary:
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.

BUG: 390652

Reviewers: #spectacle, rkflx, ngraham, broulik

Reviewed By: #spectacle, rkflx, ngraham

Subscribers: davidedmundson, broulik, ngraham

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D10672
parent d47ab66e
......@@ -321,6 +321,15 @@ QPixmap X11ImageGrabber::getToplevelPixmap(QRect rect, bool blendPointer)
// Treat a null rect as an alias for capturing fullscreen
if (!rect.isValid()) {
rect = getDrawableGeometry(rootWindow);
} else {
QRegion screenRegion;
for (auto screen : QGuiApplication::screens()) {
QRect screenRect = screen->geometry();
screenRect.setSize(screenRect.size() * screen->devicePixelRatio());
screenRegion += screenRect;
}
rect = (screenRegion & rect).boundingRect();
}
QPixmap nativePixmap = getPixmapFromDrawable(rootWindow, rect);
......
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