From d0c8c05643865244c0ecb981b0ed7237e2aee707 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sun, 21 Jul 2019 17:27:12 +0200 Subject: dev-qt/qtwidgets: Add KDE (krita) upstream recommended backports See also: https://mail.kde.org/pipermail/distributions/2019-April/000317.html Package-Manager: Portage-2.3.69, Repoman-2.3.16 Signed-off-by: Andreas Sturmlechner --- ...ts-5.12.4-fix-notification-of-QDockWidget.patch | 37 +++++++++++++ ...enterleaveEvent-for-accepted-QTabletEvent.patch | 49 +++++++++++++++++ dev-qt/qtwidgets/qtwidgets-5.12.4-r2.ebuild | 63 ++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 dev-qt/qtwidgets/files/qtwidgets-5.12.4-fix-notification-of-QDockWidget.patch create mode 100644 dev-qt/qtwidgets/files/qtwidgets-5.12.4-synth-enterleaveEvent-for-accepted-QTabletEvent.patch create mode 100644 dev-qt/qtwidgets/qtwidgets-5.12.4-r2.ebuild (limited to 'dev-qt/qtwidgets') 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(spy.at(0).at(0)), ++ Qt::NoDockWidgetArea); ++ spy.clear(); ++ + dw.setFloating(false); + QTRY_COMPARE(spy.count(), 1); + QCOMPARE(qvariant_cast(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 +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 diff --git a/dev-qt/qtwidgets/qtwidgets-5.12.4-r2.ebuild b/dev-qt/qtwidgets/qtwidgets-5.12.4-r2.ebuild new file mode 100644 index 000000000000..9d414296830e --- /dev/null +++ b/dev-qt/qtwidgets/qtwidgets-5.12.4-r2.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +QT5_MODULE="qtbase" +inherit qt5-build + +DESCRIPTION="Set of components for creating classic desktop-style UIs for the Qt5 framework" + +if [[ ${QT5_BUILD_TYPE} == release ]]; then + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd" +fi + +# keep IUSE defaults in sync with qtgui +IUSE="gles2 gtk +png +xcb" + +DEPEND=" + ~dev-qt/qtcore-${PV} + ~dev-qt/qtgui-${PV}[gles2=,png=,xcb?] + gtk? ( + ~dev-qt/qtgui-${PV}[dbus] + x11-libs/gtk+:3 + x11-libs/libX11 + x11-libs/pango + ) +" +RDEPEND="${DEPEND}" + +QT5_TARGET_SUBDIRS=( + src/tools/uic + src/widgets + src/plugins/platformthemes +) + +QT5_GENTOO_CONFIG=( + gtk:gtk3: + ::widgets + !:no-widgets: +) + +QT5_GENTOO_PRIVATE_CONFIG=( + :widgets +) + +PATCHES+=( + "${FILESDIR}/${P}-revert-reset-winId.patch" # bug 689704 + "${FILESDIR}/${P}-fix-notification-of-QDockWidget.patch" + # Still pending: https://codereview.qt-project.org/c/qt/qtbase/+/255384 + "${FILESDIR}/${P}-synth-enterleaveEvent-for-accepted-QTabletEvent.patch" +) + +src_configure() { + local myconf=( + -opengl $(usex gles2 es2 desktop) + $(qt_use gtk) + -gui + $(qt_use png libpng system) + -widgets + $(qt_use xcb xcb system) + $(usex xcb '-xcb-xlib -xcb-xinput -xkb -xkbcommon' '') + ) + qt5-build_src_configure +} -- cgit v1.2.3-65-gdbad