From 7ded77dda5a050db7064430d1a45948bca8194ab Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 2 Apr 2019 16:07:34 +0200 Subject: Quick fix for not working input handling for eglfs On eglfs platform input events are driven by libinput and do not have window information as such. They are simply delivered based on QGuiApplication::topLevelAt window selection. In case of WebEnigne, QQuickWindow is returned as top level window. QQuickWidget uses this QQuickWindow as an offscreen window, however since 561b932 we fake 'visible' and 'visibility' values so windows api in qml can use those properties. This ends up with broken event delivery on eglfs, since window is offscreen and therefore not really visible. Make a minimalistic change to fix the issue, without braking QTBUG-49054, which requires 'visibility' to have fake values, and 'visible' will keep window as not visible for event delivery system. Fix encapsulation of setVisible(), prevent accidental window creation when setVsiible() called from qml via binding. The proper fix would require for example adding some new flag to underlying offscreen window, which could be used by event window selection mechanism or rework of qquickwidget offscreen window parameters expose to qml. Task-number: QTBUG-65761 Task-number: QTBUG-49054 Change-Id: I2a307ee5613771adf6d31f1c3cc4b4a25d7620df Reviewed-by: Ulf Hermann --- tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp index aaf37b32cd..fd5c3653ad 100644 --- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp +++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp @@ -161,7 +161,7 @@ void tst_qquickwidget::showHide() window.show(); QVERIFY(QTest::qWaitForWindowExposed(&window)); - QVERIFY(childView->quickWindow()->isVisible()); + QVERIFY(!childView->quickWindow()->isVisible()); // this window is always not visible see QTBUG-65761 QVERIFY(childView->quickWindow()->visibility() != QWindow::Hidden); window.hide(); @@ -612,7 +612,7 @@ void tst_qquickwidget::synthMouseFromTouch() childView->resize(300, 300); window.show(); QVERIFY(QTest::qWaitForWindowActive(&window)); - QVERIFY(childView->quickWindow()->isVisible()); + QVERIFY(!childView->quickWindow()->isVisible()); // this window is always not visible see QTBUG-65761 QVERIFY(item->isVisible()); QPoint p1 = QPoint(20, 20); -- cgit v1.2.3