summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-01-22 00:43:56 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-01-26 17:18:18 +0100
commit8359e44324a9554d1a340d91a0df962e83302228 (patch)
tree46fe061a94182a6f5978ce5da352df5f010ab4ba /tests/auto
parent5d1bb2ed575f88d147fb6140aa846a8665a102b8 (diff)
Offscreen: Fix implementation of QScreen::grabWindow
If id == 0, then we should grab the specified rect from the screen. To do that, find all windows intersecting with the screen geometry, and compose their backing store images into a screen-size pixmap. Otherwise, find the respective backing store and grab only that. Remove the old code respecting the desktop widget, which is no longer a thing in Qt 6. The code was also wrongly grabbing only the first containing - not intersecting - window's backing store into the screen pixmap. Enable the QScreen::grabImage test for the offscreen platform, where it now passes. Task-number: QTBUG-99962 Change-Id: I16eca7b082d65095a62c73624f86a4423e997a7a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/kernel/qscreen/tst_qscreen.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
index 83d476e812..a6e9535e88 100644
--- a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
+++ b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
@@ -205,9 +205,6 @@ void tst_QScreen::orientationChange()
void tst_QScreen::grabWindow_data()
{
- if (QGuiApplication::platformName().startsWith(QLatin1String("offscreen"), Qt::CaseInsensitive))
- QSKIP("Offscreen: Screen grabbing not implemented.");
-
QTest::addColumn<int>("screenIndex");
QTest::addColumn<QByteArray>("screenName");
QTest::addColumn<bool>("grabWindow");