diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-09-16 08:16:21 +0200 |
---|---|---|
committer | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-09-16 08:17:12 +0200 |
commit | b4233b2f606617542c594e411640ef2867152d29 (patch) | |
tree | fc1fc95fa2df4ab21478e120feba8b34c1585db5 /tests/auto/client/datadevicev1/tst_datadevicev1.cpp | |
parent | 92768cf8d48d6fb62e1a0d124ea9cdec447df4d1 (diff) | |
parent | 382e3292aa0eb6addac84ddefeedc98c7f3b41b2 (diff) |
Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
src/client/qwaylanddatadevice.cpp
src/client/qwaylandinputcontext.cpp
src/client/qwaylandinputdevice.cpp
src/client/qwaylandwindow.cpp
src/compositor/compositor_api/compositor_api.pri
src/compositor/compositor_api/qwaylandquickitem.cpp
Change-Id: Ice0d8c7d869c9c46113d6ee6ba3adf895a71d58f
Diffstat (limited to 'tests/auto/client/datadevicev1/tst_datadevicev1.cpp')
-rw-r--r-- | tests/auto/client/datadevicev1/tst_datadevicev1.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/auto/client/datadevicev1/tst_datadevicev1.cpp b/tests/auto/client/datadevicev1/tst_datadevicev1.cpp index 35ac72528..e3babceb5 100644 --- a/tests/auto/client/datadevicev1/tst_datadevicev1.cpp +++ b/tests/auto/client/datadevicev1/tst_datadevicev1.cpp @@ -30,9 +30,8 @@ #include <QtGui/QRasterWindow> #include <QtGui/QOpenGLWindow> - -//TODO: move? #include <QtGui/QClipboard> +#include <QtGui/QDrag> using namespace MockCompositor; @@ -60,6 +59,7 @@ private slots: void pasteUtf8(); void destroysPreviousSelection(); void destroysSelectionWithSurface(); + void dragWithoutFocus(); }; void tst_datadevicev1::initTestCase() @@ -215,5 +215,22 @@ void tst_datadevicev1::destroysSelectionWithSurface() QCOMPOSITOR_TRY_COMPARE(dataDevice()->m_sentSelectionOffers.size(), 0); } +// The application should not crash if it attempts to start a drag operation +// when it doesn't have input focus (QTBUG-76368) +void tst_datadevicev1::dragWithoutFocus() +{ + QRasterWindow window; + window.resize(64, 64); + window.show(); + QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial); + + auto *mimeData = new QMimeData; + const QByteArray data("testData"); + mimeData->setData("text/plain", data); + QDrag drag(&window); + drag.setMimeData(mimeData); + drag.exec(); +} + QCOMPOSITOR_TEST_MAIN(tst_datadevicev1) #include "tst_datadevicev1.moc" |