summaryrefslogtreecommitdiff
path: root/dev-qt/qtwidgets/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-08-02 19:14:55 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-08-02 19:14:55 +0100
commitb24bd25253fe093f722ab576d29fdc41d04cb1ee (patch)
tree0fcf2afd9f852c4d4c291cf8afaa2c244d598105 /dev-qt/qtwidgets/files
parent121ed4eec41fbf03e1998d09eede1bf449da63b9 (diff)
gentoo resync : 02.08.2019
Diffstat (limited to 'dev-qt/qtwidgets/files')
-rw-r--r--dev-qt/qtwidgets/files/qtwidgets-5.12.4-fix-notification-of-QDockWidget.patch37
-rw-r--r--dev-qt/qtwidgets/files/qtwidgets-5.12.4-synth-enterleaveEvent-for-accepted-QTabletEvent.patch49
2 files changed, 86 insertions, 0 deletions
diff --git a/dev-qt/qtwidgets/files/qtwidgets-5.12.4-fix-notification-of-QDockWidget.patch b/dev-qt/qtwidgets/files/qtwidgets-5.12.4-fix-notification-of-QDockWidget.patch
new file mode 100644
index 000000000000..5f72fef9d34c
--- /dev/null
+++ b/dev-qt/qtwidgets/files/qtwidgets-5.12.4-fix-notification-of-QDockWidget.patch
@@ -0,0 +1,37 @@
+Description: fix notification of QDockWidget when it gets undocked
+ Before the patch the notification was emitted only when the docker
+ was attached to the panel or changed a position on it.
+ .
+ It looks like the old behavior was documented in a unittest,
+ so this patch might actually be a "behavior change".
+ .
+ Note: https://mail.kde.org/pipermail/distributions/2019-April/000317.html
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=06b8644953fc5267
+Last-Update: 2019-06-14
+
+--- a/src/widgets/widgets/qdockwidget.cpp
++++ b/src/widgets/widgets/qdockwidget.cpp
+@@ -1171,6 +1171,8 @@ void QDockWidgetPrivate::setWindowState(
+ QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q);
+ if (mwlayout)
+ emit q->dockLocationChanged(mwlayout->dockWidgetArea(q));
++ } else {
++ emit q->dockLocationChanged(Qt::NoDockWidgetArea);
+ }
+ }
+
+--- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
++++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
+@@ -669,7 +669,11 @@ void tst_QDockWidget::dockLocationChange
+ spy.clear();
+
+ dw.setFloating(true);
+- QTest::qWait(100);
++ QTRY_COMPARE(spy.count(), 1);
++ QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)),
++ Qt::NoDockWidgetArea);
++ spy.clear();
++
+ dw.setFloating(false);
+ QTRY_COMPARE(spy.count(), 1);
+ QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)),
diff --git a/dev-qt/qtwidgets/files/qtwidgets-5.12.4-synth-enterleaveEvent-for-accepted-QTabletEvent.patch b/dev-qt/qtwidgets/files/qtwidgets-5.12.4-synth-enterleaveEvent-for-accepted-QTabletEvent.patch
new file mode 100644
index 000000000000..ab225009ab43
--- /dev/null
+++ b/dev-qt/qtwidgets/files/qtwidgets-5.12.4-synth-enterleaveEvent-for-accepted-QTabletEvent.patch
@@ -0,0 +1,49 @@
+From de811eca72d17b7ef734afc1d44af00cc5952f22 Mon Sep 17 00:00:00 2001
+From: Dmitry Kazakov <dimula73@gmail.com>
+Date: Mon, 11 Mar 2019 13:18:06 +0300
+Subject: [PATCH] Synthesize Enter/LeaveEvent for accepted QTabletEvent
+
+When the tablet event is accepted, then Qt doesn't synthesize a mouse
+event, it means that QApplicationPrivate::sendMouseEvent() will not be
+called, and, therefore, enter/leave events will not be dispatched.
+
+The patch looks a bit hackish. Ideally, the synthesize should happen
+in QGuiApplicationPrivate::processTabletEvent(), which takes the decision
+about synthesizing mouse events. But there is not enough information
+on this level: neither qt_last_mouse_receiver nor the receiver widget
+are known at this stage.
+
+On Windows and other platforms where there is a parallel stream of
+mouse events synthesized by the platform, we shouldn't generate these
+events manually.
+
+Change-Id: Ifbad6284483ee282ad129db54606f5d0d9ddd633
+---
+ src/widgets/kernel/qwidgetwindow.cpp | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
+index fbc71cd0ea1..729a7f701ae 100644
+--- a/src/widgets/kernel/qwidgetwindow.cpp
++++ b/src/widgets/kernel/qwidgetwindow.cpp
+@@ -1051,6 +1051,18 @@ void QWidgetWindow::handleTabletEvent(QTabletEvent *event)
+ event->setAccepted(ev.isAccepted());
+ }
+
++ /**
++ * Synthesize Enter/Leave events if it is requested by the system and user
++ */
++ if (widget != qt_last_mouse_receiver &&
++ event->isAccepted() &&
++ !QWindowSystemInterfacePrivate::TabletEvent::platformSynthesizesMouse &&
++ qApp->testAttribute(Qt::AA_SynthesizeMouseForUnhandledTabletEvents)) {
++
++ QApplicationPrivate::dispatchEnterLeave(widget, qt_last_mouse_receiver, event->globalPos());
++ qt_last_mouse_receiver = widget;
++ }
++
+ if (event->type() == QEvent::TabletRelease && event->buttons() == Qt::NoButton)
+ qt_tablet_target = 0;
+ }
+--
+2.16.3