[SCM] qtbase packaging branch, ubuntu, updated. 5.6.1+dfsg-3ubuntu3-8-g50d13ca
Timo Jyrinki
timo at moszumanska.debian.org
Tue Sep 13 11:17:54 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtbase.git;a=commitdiff;h=50d13ca
The following commit has been merged in the ubuntu branch:
commit 50d13caf4e289a04edc991eebbeed34fbcdb57ed
Author: Timo Jyrinki <timo.jyrinki at canonical.com>
Date: Tue Sep 13 11:17:40 2016 +0000
debian/patches/Avoid-artifacts-when-hiding-or-closing-a-QOpenGLWidg.patch debian/patches/QtWidgets-Reduce-paint-events-when-resizing-native-w.patch debian/patches/QtWidgets-Send-show-hide-event-to-children-on-restor.patch:
* debian/patches/Avoid-artifacts-when-hiding-or-closing-a-QOpenGLWidg.patch
debian/patches/QtWidgets-Reduce-paint-events-when-resizing-native-w.patch
debian/patches/QtWidgets-Send-show-hide-event-to-children-on-restor.patch:
- Fix event sending to children, hurting Oxide-Qt use on desktop
(LP: #1613670)
---
debian/changelog | 5 +
...acts-when-hiding-or-closing-a-QOpenGLWidg.patch | 93 +++++++++
...educe-paint-events-when-resizing-native-w.patch | 94 +++++++++
...end-show-hide-event-to-children-on-restor.patch | 215 +++++++++++++++++++++
debian/patches/series | 3 +
5 files changed, 410 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 134611b..80c03bd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,11 @@ qtbase-opensource-src (5.6.1+dfsg-3ubuntu4) UNRELEASED; urgency=medium
- Remove related qdtoa symbol.
* debian/patches/Fix-parsing-of-tzfile-5-POSIX-rule-zone-names-with-b.patch:
- Fix parsing of rule zone names for certain time zones (LP: #1622089)
+ * debian/patches/Avoid-artifacts-when-hiding-or-closing-a-QOpenGLWidg.patch
+ debian/patches/QtWidgets-Reduce-paint-events-when-resizing-native-w.patch
+ debian/patches/QtWidgets-Send-show-hide-event-to-children-on-restor.patch:
+ - Fix event sending to children, hurting Oxide-Qt use on desktop
+ (LP: #1613670)
-- Timo Jyrinki <timo-jyrinki at ubuntu.com> Mon, 12 Sep 2016 05:42:31 +0000
diff --git a/debian/patches/Avoid-artifacts-when-hiding-or-closing-a-QOpenGLWidg.patch b/debian/patches/Avoid-artifacts-when-hiding-or-closing-a-QOpenGLWidg.patch
new file mode 100644
index 0000000..9df9ba0
--- /dev/null
+++ b/debian/patches/Avoid-artifacts-when-hiding-or-closing-a-QOpenGLWidg.patch
@@ -0,0 +1,93 @@
+From 2a7cee47e5e84c73e32a6953e145771196645f1a Mon Sep 17 00:00:00 2001
+From: Laszlo Agocs <laszlo.agocs at qt.io>
+Date: Wed, 22 Jun 2016 10:08:28 +0200
+Subject: [PATCH] Avoid artifacts when hiding or closing a QOpenGLWidget or
+ QQuickWidget child
+
+windows and xcb enables SwitchableWidgetComposition meaning that widget
+backing stores will fall back to the normal flush path when no render-to-texture
+widgets are visible anymore in the window. This switch however can lead to
+artifacts with the image of the rtt widget remaining visible until the next
+full bacinkgstore sync. The safe and simple way around this is to do the
+switch only in the next flush, keeping the flush where the switch is
+discovered on the OpenGL-based composition path still.
+
+Task-number: QTBUG-54241
+Change-Id: I1d3f10999f69c58efa791dd724891add56949dee
+Reviewed-by: Paul Olav Tvete <paul.tvete at qt.io>
+---
+ src/widgets/kernel/qwidget.cpp | 1 +
+ src/widgets/kernel/qwidget_p.h | 1 +
+ src/widgets/kernel/qwidgetbackingstore.cpp | 18 ++++++++++++++++--
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
+index 0376ab8..57148eb 100644
+--- a/src/widgets/kernel/qwidget.cpp
++++ b/src/widgets/kernel/qwidget.cpp
+@@ -274,6 +274,7 @@ QWidgetPrivate::QWidgetPrivate(int version)
+ #endif
+ #ifndef QT_NO_OPENGL
+ , renderToTextureReallyDirty(1)
++ , renderToTextureComposeActive(0)
+ #endif
+ #if defined(Q_OS_WIN)
+ , noPaintOnScreen(0)
+diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
+index 9d4bdc7..9681cb0 100644
+--- a/src/widgets/kernel/qwidget_p.h
++++ b/src/widgets/kernel/qwidget_p.h
+@@ -744,6 +744,7 @@ public:
+ #endif
+ #ifndef QT_NO_OPENGL
+ uint renderToTextureReallyDirty : 1;
++ uint renderToTextureComposeActive : 1;
+ #endif
+
+ // *************************** Platform specific ************************************
+diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
+index 5d13fb9..7473dd1 100644
+--- a/src/widgets/kernel/qwidgetbackingstore.cpp
++++ b/src/widgets/kernel/qwidgetbackingstore.cpp
+@@ -61,6 +61,8 @@ QT_BEGIN_NAMESPACE
+
+ extern QRegion qt_dirtyRegion(QWidget *);
+
++Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList)
++
+ /**
+ * Flushes the contents of the backingStore into the screen area of widget.
+ * tlwOffset is the position of the top level widget relative to the window surface.
+@@ -103,6 +105,20 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion ®ion, QBack
+ offset += widget->mapTo(tlw, QPoint());
+
+ #ifndef QT_NO_OPENGL
++ const bool compositionWasActive = widget->d_func()->renderToTextureComposeActive;
++ if (!widgetTextures) {
++ widget->d_func()->renderToTextureComposeActive = false;
++ // Detect the case of falling back to the normal flush path when no
++ // render-to-texture widgets are visible anymore. We will force one
++ // last flush to go through the OpenGL-based composition to prevent
++ // artifacts. The next flush after this one will use the normal path.
++ if (compositionWasActive)
++ widgetTextures = qt_dummy_platformTextureList;
++ } else {
++ widget->d_func()->renderToTextureComposeActive = true;
++ }
++
++ // re-test since we may have been forced to this path via the dummy texture list above
+ if (widgetTextures) {
+ qt_window_private(tlw->windowHandle())->compositing = true;
+ widget->window()->d_func()->sendComposeStatus(widget->window(), false);
+@@ -978,8 +994,6 @@ static void findAllTextureWidgetsRecursively(QWidget *tlw, QWidget *widget)
+ }
+ }
+
+-Q_GLOBAL_STATIC(QPlatformTextureList, qt_dummy_platformTextureList)
+-
+ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
+ {
+ foreach (QPlatformTextureList *tl, QWidgetPrivate::get(tlw)->topData()->widgetTextures) {
+--
+2.9.3
+
diff --git a/debian/patches/QtWidgets-Reduce-paint-events-when-resizing-native-w.patch b/debian/patches/QtWidgets-Reduce-paint-events-when-resizing-native-w.patch
new file mode 100644
index 0000000..f3d9c5d
--- /dev/null
+++ b/debian/patches/QtWidgets-Reduce-paint-events-when-resizing-native-w.patch
@@ -0,0 +1,94 @@
+From bc410cc706e107881d3ee982287441993cabb8a6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16 at wp.pl>
+Date: Mon, 1 Feb 2016 11:49:02 +0100
+Subject: [PATCH] QtWidgets: Reduce paint events when resizing native widget
+
+This patch reduces paint events by removing code which sets native
+widgets dirty in QWidgetWindow::handleExposeEvent. Native widgets are
+also marked dirty in QWidgetPrivate::drawWidget, so it is enough for
+proper painting.
+
+This restores Qt4 behavior when one resize means one repaint for native
+widgets. Without this patch the native widget is marked as dirty on
+every expose event, so one repaint is from syncBackingStore and second
+(or more) is from marking the widget dirty explicitly.
+
+This patch improves performance of native widgets and it also reduces
+locks when paint event is v-synced, e.g. on OpenGL swap buffers or on
+any other technology like VDPAU, VA-API, etc.
+
+Added autotest for checking number of paint events for native widgets.
+
+Task-number: QTBUG-50796
+Change-Id: I4e1649069e2e73d15b038fd1834d0551915252ee
+Reviewed-by: Friedemann Kleint <Friedemann.Kleint at qt.io>
+---
+ src/widgets/kernel/qwidgetwindow.cpp | 8 +-------
+ .../kernel/qwidget_window/tst_qwidget_window.cpp | 24 ++++++++++++++++++++++
+ 2 files changed, 25 insertions(+), 7 deletions(-)
+
+diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
+index 5290d79..872572a 100644
+--- a/src/widgets/kernel/qwidgetwindow.cpp
++++ b/src/widgets/kernel/qwidgetwindow.cpp
+@@ -873,14 +873,8 @@ void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
+ {
+ if (isExposed()) {
+ m_widget->setAttribute(Qt::WA_Mapped);
+- if (!event->region().isNull()) {
+- // Exposed native widgets need to be marked dirty to get them repainted correctly.
+- if (m_widget->internalWinId() && !m_widget->isWindow() && m_widget->isVisible() && m_widget->updatesEnabled()) {
+- if (QWidgetBackingStore *bs = m_widget->d_func()->maybeBackingStore())
+- bs->markDirty(event->region(), m_widget);
+- }
++ if (!event->region().isNull())
+ m_widget->d_func()->syncBackingStore(event->region());
+- }
+ } else {
+ m_widget->setAttribute(Qt::WA_Mapped, false);
+ }
+diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+index 27be063..3a4b563 100644
+--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
++++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+@@ -88,6 +88,7 @@ private slots:
+
+ void tst_showWithoutActivating();
+ void tst_paintEventOnSecondShow();
++ void tst_paintEventOnResize_QTBUG50796();
+
+ #ifndef QT_NO_DRAGANDDROP
+ void tst_dnd();
+@@ -369,6 +370,29 @@ void tst_QWidget_window::tst_paintEventOnSecondShow()
+ QTRY_VERIFY(w.paintEventCount > 0);
+ }
+
++void tst_QWidget_window::tst_paintEventOnResize_QTBUG50796()
++{
++ const QRect availableGeo = QGuiApplication::primaryScreen()->availableGeometry();
++
++ QWidget root;
++ root.setGeometry(availableGeo.width()/2 - 100, availableGeo.height()/2 - 100,
++ 200, 200);
++
++ PaintTestWidget *native = new PaintTestWidget(&root);
++ native->winId(); // We're testing native widgets
++ native->setGeometry(10, 10, 50, 50);
++
++ root.show();
++ QVERIFY(QTest::qWaitForWindowExposed(&root));
++ QVERIFY(QTest::qWaitForWindowActive(&root));
++ QVERIFY(native->isVisible());
++
++ native->paintEventCount = 0;
++ native->resize(native->width() + 10, native->height() + 10);
++ QTest::qWait(50); // Wait for paint events
++ QTRY_COMPARE(native->paintEventCount, 1); // Only one paint event must occur
++}
++
+ #ifndef QT_NO_DRAGANDDROP
+
+ /* DnD test for QWidgetWindow (handleDrag*Event() functions).
+--
+2.9.3
+
diff --git a/debian/patches/QtWidgets-Send-show-hide-event-to-children-on-restor.patch b/debian/patches/QtWidgets-Send-show-hide-event-to-children-on-restor.patch
new file mode 100644
index 0000000..ad31b61
--- /dev/null
+++ b/debian/patches/QtWidgets-Send-show-hide-event-to-children-on-restor.patch
@@ -0,0 +1,215 @@
+From 3b8df0ea44b048b8fcc4317ffdfd074e2547a95e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16 at wp.pl>
+Date: Thu, 24 Mar 2016 23:50:24 +0100
+Subject: [PATCH] QtWidgets: Send show/hide event to children on
+ restore/minimize
+
+Child widgets should get the show/hide event when the TLW changes its
+state, because child widgets are also visible or invisible. This
+restores the Qt4 behavior (fixes the Qt4->Qt5 regression).
+
+Restoring/minimizing the TLW now sends the spontaneous show/hide event.
+
+Show events are now handled also in the expose event handler in the
+QWidgetWindow class, because the show event must occur before the
+expose event to avoid possible flicker e.g. the OpenGL content. This
+can happen e.g. on XCB platform. If the "WindowStateChange" event occur
+before the expose event (e.g. Windows platform) then the code in expose
+event handler will be ignored to prevent event duplications.
+
+Added autotest.
+
+Task-number: QTBUG-50589
+Change-Id: Ie9a9329b1f29bff876de28d5948d0d5fb6bc1f05
+Reviewed-by: Friedemann Kleint <Friedemann.Kleint at qt.io>
+---
+ src/widgets/kernel/qwidget.cpp | 18 +++++++--
+ src/widgets/kernel/qwidget_p.h | 2 +
+ src/widgets/kernel/qwidgetwindow.cpp | 34 +++++++++++++++-
+ tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 48 ++++++++++++++++++++---
+ 4 files changed, 92 insertions(+), 10 deletions(-)
+
+diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
+index b1d80d7..b99fca6 100644
+--- a/src/widgets/kernel/qwidget.cpp
++++ b/src/widgets/kernel/qwidget.cpp
+@@ -276,6 +276,8 @@ QWidgetPrivate::QWidgetPrivate(int version)
+ , renderToTextureReallyDirty(1)
+ , renderToTextureComposeActive(0)
+ #endif
++ , childrenHiddenByWState(0)
++ , childrenShownByExpose(0)
+ #if defined(Q_OS_WIN)
+ , noPaintOnScreen(0)
+ #endif
+@@ -9005,13 +9007,23 @@ bool QWidget::event(QEvent *event)
+ case QEvent::WindowStateChange: {
+ const bool wasMinimized = static_cast<const QWindowStateChangeEvent *>(event)->oldState() & Qt::WindowMinimized;
+ if (wasMinimized != isMinimized()) {
++ QWidget *widget = const_cast<QWidget *>(this);
+ if (wasMinimized) {
+- QShowEvent showEvent;
+- QCoreApplication::sendEvent(const_cast<QWidget *>(this), &showEvent);
++ // Always send the spontaneous events here, otherwise it can break the application!
++ if (!d->childrenShownByExpose) {
++ // Show widgets only when they are not yet shown by the expose event
++ d->showChildren(true);
++ QShowEvent showEvent;
++ QCoreApplication::sendSpontaneousEvent(widget, &showEvent);
++ }
++ d->childrenHiddenByWState = false; // Set it always to "false" when window is restored
+ } else {
+ QHideEvent hideEvent;
+- QCoreApplication::sendEvent(const_cast<QWidget *>(this), &hideEvent);
++ QCoreApplication::sendSpontaneousEvent(widget, &hideEvent);
++ d->hideChildren(true);
++ d->childrenHiddenByWState = true;
+ }
++ d->childrenShownByExpose = false; // Set it always to "false" when window state changes
+ }
+ changeEvent(event);
+ }
+diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
+index b130c54..5f07a88 100644
+--- a/src/widgets/kernel/qwidget_p.h
++++ b/src/widgets/kernel/qwidget_p.h
+@@ -746,6 +746,8 @@ public:
+ uint renderToTextureReallyDirty : 1;
+ uint renderToTextureComposeActive : 1;
+ #endif
++ uint childrenHiddenByWState : 1;
++ uint childrenShownByExpose : 1;
+
+ // *************************** Platform specific ************************************
+ #if defined(Q_OS_WIN)
+diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
+index 872572a..aa7bcc2 100644
+--- a/src/widgets/kernel/qwidgetwindow.cpp
++++ b/src/widgets/kernel/qwidgetwindow.cpp
+@@ -871,10 +871,40 @@ void QWidgetWindow::handleDropEvent(QDropEvent *event)
+
+ void QWidgetWindow::handleExposeEvent(QExposeEvent *event)
+ {
+- if (isExposed()) {
++ QWidgetPrivate *wPriv = m_widget->d_func();
++ const bool exposed = isExposed();
++
++ if (wPriv->childrenHiddenByWState) {
++ // If widgets has been previously hidden by window state change event
++ // and they aren't yet shown...
++ if (exposed) {
++ // If the window becomes exposed...
++ if (!wPriv->childrenShownByExpose) {
++ // ... and they haven't been shown by this function yet - show it.
++ wPriv->showChildren(true);
++ QShowEvent showEvent;
++ QCoreApplication::sendSpontaneousEvent(m_widget, &showEvent);
++ wPriv->childrenShownByExpose = true;
++ }
++ } else {
++ // If the window becomes not exposed...
++ if (wPriv->childrenShownByExpose) {
++ // ... and child widgets was previously shown by the expose event - hide widgets again.
++ // This is a workaround, because sometimes when window is minimized programatically,
++ // the QPA can notify that the window is exposed after changing window state to minimized
++ // and then, the QPA can send next expose event with null exposed region (not exposed).
++ wPriv->hideChildren(true);
++ QHideEvent hideEvent;
++ QCoreApplication::sendSpontaneousEvent(m_widget, &hideEvent);
++ wPriv->childrenShownByExpose = false;
++ }
++ }
++ }
++
++ if (exposed) {
+ m_widget->setAttribute(Qt::WA_Mapped);
+ if (!event->region().isNull())
+- m_widget->d_func()->syncBackingStore(event->region());
++ wPriv->syncBackingStore(event->region());
+ } else {
+ m_widget->setAttribute(Qt::WA_Mapped, false);
+ }
+diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+index b7c1526..34a1835 100644
+--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
++++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+@@ -294,6 +294,7 @@ private slots:
+ void showHideEvent_data();
+ void showHideEvent();
+ void showHideEventWhileMinimize();
++ void showHideChildrenWhileMinimize_QTBUG50589();
+
+ void lostUpdatesOnHide();
+
+@@ -4078,19 +4079,30 @@ class ShowHideEventWidget : public QWidget
+ {
+ public:
+ int numberOfShowEvents, numberOfHideEvents;
++ int numberOfSpontaneousShowEvents, numberOfSpontaneousHideEvents;
+
+ ShowHideEventWidget(QWidget *parent = 0)
+- : QWidget(parent), numberOfShowEvents(0), numberOfHideEvents(0)
++ : QWidget(parent)
++ , numberOfShowEvents(0), numberOfHideEvents(0)
++ , numberOfSpontaneousShowEvents(0), numberOfSpontaneousHideEvents(0)
+ { }
+
+ void create()
+ { QWidget::create(); }
+
+- void showEvent(QShowEvent *)
+- { ++numberOfShowEvents; }
++ void showEvent(QShowEvent *e)
++ {
++ ++numberOfShowEvents;
++ if (e->spontaneous())
++ ++numberOfSpontaneousShowEvents;
++ }
+
+- void hideEvent(QHideEvent *)
+- { ++numberOfHideEvents; }
++ void hideEvent(QHideEvent *e)
++ {
++ ++numberOfHideEvents;
++ if (e->spontaneous())
++ ++numberOfSpontaneousHideEvents;
++ }
+ };
+
+ void tst_QWidget::showHideEvent_data()
+@@ -4182,6 +4194,32 @@ void tst_QWidget::showHideEventWhileMinimize()
+ QTRY_COMPARE(widget.numberOfShowEvents, showEventsBeforeMinimize + 1);
+ }
+
++void tst_QWidget::showHideChildrenWhileMinimize_QTBUG50589()
++{
++ const QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
++ if (!pi->hasCapability(QPlatformIntegration::MultipleWindows)
++ || !pi->hasCapability(QPlatformIntegration::NonFullScreenWindows)
++ || !pi->hasCapability(QPlatformIntegration::WindowManagement)) {
++ QSKIP("This test requires window management capabilities");
++ }
++
++ QWidget parent;
++ ShowHideEventWidget child(&parent);
++
++ parent.setWindowTitle(QTest::currentTestFunction());
++ parent.resize(m_testWidgetSize);
++ centerOnScreen(&parent);
++ parent.show();
++ QVERIFY(QTest::qWaitForWindowExposed(&parent));
++
++ const int showEventsBeforeMinimize = child.numberOfSpontaneousShowEvents;
++ const int hideEventsBeforeMinimize = child.numberOfSpontaneousHideEvents;
++ parent.showMinimized();
++ QTRY_COMPARE(child.numberOfSpontaneousHideEvents, hideEventsBeforeMinimize + 1);
++ parent.showNormal();
++ QTRY_COMPARE(child.numberOfSpontaneousShowEvents, showEventsBeforeMinimize + 1);
++}
++
+ void tst_QWidget::update()
+ {
+ #ifdef Q_OS_OSX
+--
+2.9.3
+
diff --git a/debian/patches/series b/debian/patches/series
index 0ea167c..808ea2e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,6 +16,9 @@ Replace-qdtoa-and-qstrtod-implementation-by-a-3rdpar.patch
Add-thorough-tests-for-QLocale-string-double-conversions.patch
Interpret-precision-128-as-shortest-double-conversio.patch
Fix-parsing-of-tzfile-5-POSIX-rule-zone-names-with-b.patch
+Avoid-artifacts-when-hiding-or-closing-a-QOpenGLWidg.patch
+QtWidgets-Reduce-paint-events-when-resizing-native-w.patch
+QtWidgets-Send-show-hide-event-to-children-on-restor.patch
# Debian specific.
gnukfreebsd.diff
--
qtbase packaging
More information about the pkg-kde-commits
mailing list