summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2016-03-03 22:56:23 +0300
committerDmitry Shachnev <mitya57@gmail.com>2016-03-03 22:56:23 +0300
commit2b65eed9cc77070853cf0fe372eff7c396db6037 (patch)
treeee4a1452eba24ab5aae8ec5ac11e06bec21aae1a /debian
parent45af17fa5420f5dca8e34e008e3eb5d6123d0be2 (diff)
parentf16123848853b072681aa240224136ed6e8c674d (diff)
downloadqtbase-2b65eed9cc77070853cf0fe372eff7c396db6037.tar.gz
Merge branch 'master' into experimental
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog28
-rw-r--r--debian/control6
-rw-r--r--debian/copyright4
-rw-r--r--debian/generateTLDs.sh2
-rw-r--r--debian/patches/Fix-falsely-reported-style-for-fallback-font.patch50
-rw-r--r--debian/patches/Prefer-QT_PLUGIN_PATH-over-compiled-in-paths.patch65
-rw-r--r--debian/patches/Remove-historical-4-padding-in-QFontEngine-alphaMapF.patch40
-rw-r--r--debian/patches/dbusmenu_fixes.diff364
-rw-r--r--debian/patches/dbustray_fixes.diff80
-rw-r--r--debian/patches/series6
-rw-r--r--debian/patches/xcb-fix-yet-another-crash-when-screens-are-disconnec.patch32
-rwxr-xr-xdebian/rules2
12 files changed, 673 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index c63f191..72c81e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -105,6 +105,34 @@ qtbase-opensource-src (5.6.0~beta+dfsg-1) experimental; urgency=medium
-- Dmitry Shachnev <mitya57@debian.org> Tue, 29 Dec 2015 22:29:25 +0300
+qtbase-opensource-src (5.5.1+dfsg-15) unstable; urgency=medium
+
+ [ Timo Jyrinki ]
+ * Backport XCB patch related to screen disconnection handling QTBUG-42985:
+ - xcb-fix-yet-another-crash-when-screens-are-disconnec.patch
+ * debian/patches/Prefer-QT_PLUGIN_PATH-over-compiled-in-paths.patch:
+ - Backport. Prefer QT_PLUGIN_PATH over compiled-in paths (LP: #1519927)
+ * Fix Chinese glyph font rendering with new backported upstream patches:
+ - debian/patches/Fix-falsely-reported-style-for-fallback-font.patch
+ - debian/patches/Remove-historical-4-padding-in-QFontEngine-alphaMapF.patch
+ (LP: #1475205)
+
+ [ Dmitry Shachnev ]
+ * Backport several upstream dbusmenu/dbustray related fixes from 5.6 branch.
+ * Correct license of japanese_230_50.qpf font in debian/copyright. Thanks to
+ Arnout Vandecappelle for the patch (closes: #815616).
+ * debian/generateTLDs.sh: Set -e to fail when a subcommand fails.
+ * Call generateTLDs.sh with LC_ALL=C.UTF-8, to workaround a bug in grep.
+ See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22838.
+ * Use https URIs for Vcs fields.
+ * Bump Standards-Version to 3.9.7, no changes needed.
+
+ [ Lisandro Damián Nicanor Pérez Meyer ]
+ * Remove the transitional package libqt5xcbqpa5, there are no rdeps left in
+ sid or testing.
+
+ -- Dmitry Shachnev <mitya57@debian.org> Thu, 03 Mar 2016 20:34:47 +0300
+
qtbase-opensource-src (5.5.1+dfsg-14) unstable; urgency=medium
* Backport fix_not_delivering_focus.patch to fix not delivering focusIn event
diff --git a/debian/control b/debian/control
index bf37a24..3d8290b 100644
--- a/debian/control
+++ b/debian/control
@@ -66,10 +66,10 @@ Build-Depends: debhelper (>= 9),
Build-Depends-Indep: libqt5sql5-sqlite (>= 5.6.0~),
qttools5-dev-tools (>= 5.6.0~)
Build-Conflicts: libmariadbclient-dev
-Standards-Version: 3.9.6
+Standards-Version: 3.9.7
Homepage: http://qt-project.org/
-Vcs-Git: git://anonscm.debian.org/pkg-kde/qt/qtbase.git
-Vcs-Browser: http://anonscm.debian.org/cgit/pkg-kde/qt/qtbase.git
+Vcs-Git: https://anonscm.debian.org/git/pkg-kde/qt/qtbase.git
+Vcs-Browser: https://anonscm.debian.org/cgit/pkg-kde/qt/qtbase.git
Package: libqt5core5a
Architecture: any
diff --git a/debian/copyright b/debian/copyright
index 83958c8..b8badd8 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -428,7 +428,7 @@ Files: src/3rdparty/iaccessible2/idl/*
Copyright: 2006 IBM Corporation
License: BSD-3-clause
-Files: lib/fonts/helvetica*
+Files: lib/fonts/helvetica* lib/fonts/japanese_230_50.qpf
Copyright: 1984-1989, 1994 Adobe Systems Incorporated.
1988, 1994 Digital Equipment Corporation.
License: Adobe
@@ -571,7 +571,7 @@ License: Courier
ARE GIVEN, WHETHER EXPRESS OR IMPLIED INCLUDING, BUT LIMITED TO THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-Files: lib/fonts/micro_40_50.qpf lib/fonts/japanese_230_50.qpf lib/fonts/fixed_120_50.qpf lib/fonts/fixed_70_50.qpf
+Files: lib/fonts/micro_40_50.qpf lib/fonts/fixed_120_50.qpf lib/fonts/fixed_70_50.qpf
Copyright: -
License: public-domain
A public domain font. Share and enjoy. http://www.X.org
diff --git a/debian/generateTLDs.sh b/debian/generateTLDs.sh
index 49503a0..63b4ffd 100644
--- a/debian/generateTLDs.sh
+++ b/debian/generateTLDs.sh
@@ -20,6 +20,8 @@
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+set -e
+
DESTHEADER=src/corelib/io/qurltlds_p.h
mv -f $DESTHEADER $DESTHEADER.orig
diff --git a/debian/patches/Fix-falsely-reported-style-for-fallback-font.patch b/debian/patches/Fix-falsely-reported-style-for-fallback-font.patch
new file mode 100644
index 0000000..46eb557
--- /dev/null
+++ b/debian/patches/Fix-falsely-reported-style-for-fallback-font.patch
@@ -0,0 +1,50 @@
+From a856c4a902816a7d691ca50e6f556521287be441 Mon Sep 17 00:00:00 2001
+From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
+Date: Tue, 27 Oct 2015 11:00:35 +0100
+Subject: [PATCH] Fix falsely reported style for fallback font
+
+In change 8f6b3284106fa11129e4fa6e5ec3adc6cb1f489f we override
+the fontDef of the fallback font with the fontDef of the
+original font (with the family name replaced) to fix a
+regression where boldness was not inherited by the fallback
+font.
+
+This caused a bug, though, since the contents of the fontDef
+would now misrepresent the actual font used. The side effect
+of this was that isSmoothlyScalable() returned false because
+the family and styleName combination we claim to have did
+not exist in the font database. Result: We fell back to
+native rendering for the font even though it's scalable.
+
+Weight and style are the only parts that should be inherited,
+since they are synthesized. So rather than overwriting
+the fontDef completely, we copy the weight and style when
+needed.
+
+The bug in QTBUG-42963 is still fixed after this change.
+
+[ChangeLog][Text] Fixed problem where fallback fonts for text
+with certain styles would be reported as unscalable.
+
+Change-Id: I95ef67f818852aea5a6ae8df789a52364ecb59a6
+Task-number: QTBUG-47547
+Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
+Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
+---
+ src/gui/text/qfontengine.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/src/gui/text/qfontengine.cpp
++++ b/src/gui/text/qfontengine.cpp
+@@ -1752,7 +1752,10 @@
+ request.family = fallbackFamilyAt(at - 1);
+
+ if (QFontEngine *engine = QFontDatabase::findFont(request, m_script)) {
+- engine->fontDef = request;
++ if (request.weight > QFont::Normal)
++ engine->fontDef.weight = request.weight;
++ if (request.style > QFont::StyleNormal)
++ engine->fontDef.style = request.style;
+ return engine;
+ }
+
diff --git a/debian/patches/Prefer-QT_PLUGIN_PATH-over-compiled-in-paths.patch b/debian/patches/Prefer-QT_PLUGIN_PATH-over-compiled-in-paths.patch
new file mode 100644
index 0000000..4a1c007
--- /dev/null
+++ b/debian/patches/Prefer-QT_PLUGIN_PATH-over-compiled-in-paths.patch
@@ -0,0 +1,65 @@
+From 6129be8a4ba976c42e51012ebaa9005eb402db80 Mon Sep 17 00:00:00 2001
+From: Milian Wolff <milian.wolff@kdab.com>
+Date: Mon, 27 Jul 2015 11:49:55 +0200
+Subject: [PATCH] Prefer QT_PLUGIN_PATH over compiled-in paths.
+
+Currently, when one compiles a Qt plugin that is also installed
+system wide to a local path added to QT_PLUGIN_PATH, you have no
+way to ever load it as the global plugin will always be preferred.
+This is due to the order in which the QCoreApplications::libraryPaths
+are constructed, which always appended the QT_PLUGIN_PATH contents
+to the end.
+
+Now, the QT_PLUGIN_PATH contents are put first, such that the plugins
+in there are preferred and loaded.
+
+[ChangeLog][QtCore][QPluginLoader] Fixed the search order of Qt plugins
+so that paths specified by the QT_PLUGIN_PATH environment variable
+are searched before built-in paths.
+
+Change-Id: Iad8ca2cd34e7a622c191a416c01c1c5cc1812fc9
+Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
+Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
+---
+ src/corelib/kernel/qcoreapplication.cpp | 23 ++++++++++++-----------
+ 1 file changed, 12 insertions(+), 11 deletions(-)
+
+--- a/src/corelib/kernel/qcoreapplication.cpp
++++ b/src/corelib/kernel/qcoreapplication.cpp
+@@ -2470,17 +2470,6 @@
+ QMutexLocker locker(libraryPathMutex());
+ if (!coreappdata()->app_libpaths) {
+ QStringList *app_libpaths = coreappdata()->app_libpaths = new QStringList;
+- QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
+- if (QFile::exists(installPathPlugins)) {
+- // Make sure we convert from backslashes to slashes.
+- installPathPlugins = QDir(installPathPlugins).canonicalPath();
+- if (!app_libpaths->contains(installPathPlugins))
+- app_libpaths->append(installPathPlugins);
+- }
+-
+- // If QCoreApplication is not yet instantiated,
+- // make sure we add the application path when we construct the QCoreApplication
+- if (self) self->d_func()->appendApplicationPathToLibraryPaths();
+
+ const QByteArray libPathEnv = qgetenv("QT_PLUGIN_PATH");
+ if (!libPathEnv.isEmpty()) {
+@@ -2498,6 +2487,18 @@
+ }
+ }
+ }
++
++ QString installPathPlugins = QLibraryInfo::location(QLibraryInfo::PluginsPath);
++ if (QFile::exists(installPathPlugins)) {
++ // Make sure we convert from backslashes to slashes.
++ installPathPlugins = QDir(installPathPlugins).canonicalPath();
++ if (!app_libpaths->contains(installPathPlugins))
++ app_libpaths->append(installPathPlugins);
++ }
++
++ // If QCoreApplication is not yet instantiated,
++ // make sure we add the application path when we construct the QCoreApplication
++ if (self) self->d_func()->appendApplicationPathToLibraryPaths();
+ }
+ return *(coreappdata()->app_libpaths);
+ }
diff --git a/debian/patches/Remove-historical-4-padding-in-QFontEngine-alphaMapF.patch b/debian/patches/Remove-historical-4-padding-in-QFontEngine-alphaMapF.patch
new file mode 100644
index 0000000..9d448af
--- /dev/null
+++ b/debian/patches/Remove-historical-4-padding-in-QFontEngine-alphaMapF.patch
@@ -0,0 +1,40 @@
+From 39e023b805cf2be207ef7086f6951e789e020bda Mon Sep 17 00:00:00 2001
+From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
+Date: Mon, 26 Oct 2015 15:20:41 +0100
+Subject: [PATCH] Remove historical +4 padding in
+ QFontEngine::alphaMapForGlyph()
+
+Back in the old days, we would pad the output from the font engines
+to work around problems with the GL1 paint engine such as issues
+with linear sampling, etc. This is no longer needed. Padding is
+moved into the glyph cache, and in addition to reducing performance,
+the extra padding is also making alphaMapForGlyph() and
+alphaMapBoundingBox() fall out of sync when you fall back to
+QPainterPath drawing the glyph. The result of this was that,
+when prepared, the glyph cache was sometimes not made large enough
+to hold what alphaMapForGlyph() actually produced, depending on
+the size and order of glyphs, and glyphs ending up at the end of rows
+would sometimes be missing from the output.
+
+[ChangeLog][Text] Fixed some instances of missing glyphs when
+drawing large fonts.
+
+Change-Id: Ia5982392fe1637f6ebc740db9f226fbb91f75166
+Task-number: QTBUG-47547
+Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
+Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
+---
+ src/gui/text/qfontengine.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/gui/text/qfontengine.cpp
++++ b/src/gui/text/qfontengine.cpp
+@@ -875,7 +875,7 @@
+ pt.x = -glyph_x;
+ pt.y = -glyph_y; // the baseline
+ QPainterPath path;
+- QImage im(glyph_width + 4, glyph_height, QImage::Format_ARGB32_Premultiplied);
++ QImage im(glyph_width, glyph_height, QImage::Format_ARGB32_Premultiplied);
+ im.fill(Qt::transparent);
+ QPainter p(&im);
+ p.setRenderHint(QPainter::Antialiasing);
diff --git a/debian/patches/dbusmenu_fixes.diff b/debian/patches/dbusmenu_fixes.diff
new file mode 100644
index 0000000..11712b1
--- /dev/null
+++ b/debian/patches/dbusmenu_fixes.diff
@@ -0,0 +1,364 @@
+Description: dbusmenu: refactor the code to allow dynamic updating of menus
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=9c7f37e648024a8c
+Last-Update: 2016-02-20
+
+--- a/src/platformsupport/dbusmenu/qdbusmenuadaptor.cpp
++++ b/src/platformsupport/dbusmenu/qdbusmenuadaptor.cpp
+@@ -51,8 +51,9 @@
+
+ QT_BEGIN_NAMESPACE
+
+-QDBusMenuAdaptor::QDBusMenuAdaptor(QObject *parent)
+- : QDBusAbstractAdaptor(parent)
++QDBusMenuAdaptor::QDBusMenuAdaptor(QDBusPlatformMenu *topLevelMenu)
++ : QDBusAbstractAdaptor(topLevelMenu)
++ , m_topLevelMenu(topLevelMenu)
+ {
+ setAutoRelaySignals(true);
+ }
+@@ -80,7 +81,17 @@
+ bool QDBusMenuAdaptor::AboutToShow(int id)
+ {
+ qCDebug(qLcMenu) << id;
+- return false;
++ if (id == 0) {
++ emit m_topLevelMenu->aboutToShow();
++ } else {
++ QDBusPlatformMenuItem *item = QDBusPlatformMenuItem::byId(id);
++ if (item) {
++ const QDBusPlatformMenu *menu = static_cast<const QDBusPlatformMenu *>(item->menu());
++ if (menu)
++ emit const_cast<QDBusPlatformMenu *>(menu)->aboutToShow();
++ }
++ }
++ return false; // updateNeeded (we don't know that, so false)
+ }
+
+ QList<int> QDBusMenuAdaptor::AboutToShowGroup(const QList<int> &ids, QList<int> &idErrors)
+@@ -88,6 +99,8 @@
+ qCDebug(qLcMenu) << ids;
+ Q_UNUSED(idErrors)
+ idErrors.clear();
++ Q_FOREACH (int id, ids)
++ AboutToShow(id);
+ return QList<int>(); // updatesNeeded
+ }
+
+@@ -97,9 +110,20 @@
+ Q_UNUSED(timestamp)
+ QDBusPlatformMenuItem *item = QDBusPlatformMenuItem::byId(id);
+ qCDebug(qLcMenu) << id << (item ? item->text() : QLatin1String("")) << eventId;
+- // Events occur on both menus and menuitems, but we only care if it's an item being clicked.
+ if (item && eventId == QLatin1String("clicked"))
+ item->trigger();
++ if (item && eventId == QLatin1String("hovered"))
++ emit item->hovered();
++ if (eventId == QLatin1String("closed")) {
++ // There is no explicit AboutToHide method, so map closed event to aboutToHide method
++ const QDBusPlatformMenu *menu = Q_NULLPTR;
++ if (item)
++ menu = static_cast<const QDBusPlatformMenu *>(item->menu());
++ else if (id == 0)
++ menu = m_topLevelMenu;
++ if (menu)
++ emit const_cast<QDBusPlatformMenu *>(menu)->aboutToHide();
++ }
+ }
+
+ void QDBusMenuAdaptor::EventGroup(const QDBusMenuEventList &events)
+@@ -116,7 +140,7 @@
+
+ uint QDBusMenuAdaptor::GetLayout(int parentId, int recursionDepth, const QStringList &propertyNames, QDBusMenuLayoutItem &layout)
+ {
+- uint ret = layout.populate(parentId, recursionDepth, propertyNames);
++ uint ret = layout.populate(parentId, recursionDepth, propertyNames, m_topLevelMenu);
+ qCDebug(qLcMenu) << parentId << "depth" << recursionDepth << propertyNames << layout.m_id << layout.m_properties << "revision" << ret << layout;
+ return ret;
+ }
+--- a/src/platformsupport/dbusmenu/qdbusmenuadaptor_p.h
++++ b/src/platformsupport/dbusmenu/qdbusmenuadaptor_p.h
+@@ -129,7 +129,7 @@
+ " </interface>\n"
+ "")
+ public:
+- QDBusMenuAdaptor(QObject *parent);
++ QDBusMenuAdaptor(QDBusPlatformMenu *topLevelMenu);
+ virtual ~QDBusMenuAdaptor();
+
+ public: // PROPERTIES
+@@ -155,6 +155,9 @@
+ void ItemActivationRequested(int id, uint timestamp);
+ void ItemsPropertiesUpdated(const QDBusMenuItemList &updatedProps, const QDBusMenuItemKeysList &removedProps);
+ void LayoutUpdated(uint revision, int parent);
++
++private:
++ QDBusPlatformMenu *m_topLevelMenu;
+ };
+
+ QT_END_NAMESPACE
+--- a/src/platformsupport/dbusmenu/qdbusmenutypes.cpp
++++ b/src/platformsupport/dbusmenu/qdbusmenutypes.cpp
+@@ -79,29 +79,27 @@
+ return arg;
+ }
+
+-uint QDBusMenuLayoutItem::populate(int id, int depth, const QStringList &propertyNames)
++uint QDBusMenuLayoutItem::populate(int id, int depth, const QStringList &propertyNames, const QDBusPlatformMenu *topLevelMenu)
+ {
+ qCDebug(qLcMenu) << id << "depth" << depth << propertyNames;
+ m_id = id;
+ if (id == 0) {
+ m_properties.insert(QLatin1String("children-display"), QLatin1String("submenu"));
+- Q_FOREACH (const QDBusPlatformMenu *menu, QDBusPlatformMenu::topLevelMenus()) {
+- if (menu)
+- populate(menu, depth, propertyNames);
+- }
++ if (topLevelMenu)
++ populate(topLevelMenu, depth, propertyNames);
+ return 1; // revision
+ }
+
+- const QDBusPlatformMenu *menu = QDBusPlatformMenu::byId(id);
+- if (!menu) {
+- QDBusPlatformMenuItem *item = QDBusPlatformMenuItem::byId(id);
+- if (item)
+- menu = static_cast<const QDBusPlatformMenu *>(item->menu());
++ QDBusPlatformMenuItem *item = QDBusPlatformMenuItem::byId(id);
++ if (item) {
++ const QDBusPlatformMenu *menu = static_cast<const QDBusPlatformMenu *>(item->menu());
++
++ if (menu) {
++ if (depth != 0)
++ populate(menu, depth, propertyNames);
++ return menu->revision();
++ }
+ }
+- if (depth != 0 && menu)
+- populate(menu, depth, propertyNames);
+- if (menu)
+- return menu->revision();
+
+ return 1; // revision
+ }
+@@ -117,11 +115,13 @@
+
+ void QDBusMenuLayoutItem::populate(const QDBusPlatformMenuItem *item, int depth, const QStringList &propertyNames)
+ {
+- Q_UNUSED(depth)
+- Q_UNUSED(propertyNames)
+ m_id = item->dbusID();
+ QDBusMenuItem proxy(item);
+ m_properties = proxy.m_properties;
++
++ const QDBusPlatformMenu *menu = static_cast<const QDBusPlatformMenu *>(item->menu());
++ if (depth != 0 && menu)
++ populate(menu, depth, propertyNames);
+ }
+
+ const QDBusArgument &operator<<(QDBusArgument &arg, const QDBusMenuLayoutItem &item)
+@@ -199,8 +199,7 @@
+ m_properties.insert(QLatin1String("icon-data"), buf.data());
+ }
+ }
+- if (!item->isVisible())
+- m_properties.insert(QLatin1String("visible"), false);
++ m_properties.insert(QLatin1String("visible"), item->isVisible());
+ }
+
+ QDBusMenuItemList QDBusMenuItem::items(const QList<int> &ids, const QStringList &propertyNames)
+--- a/src/platformsupport/dbusmenu/qdbusmenutypes_p.h
++++ b/src/platformsupport/dbusmenu/qdbusmenutypes_p.h
+@@ -81,7 +81,7 @@
+ class QDBusMenuLayoutItem
+ {
+ public:
+- uint populate(int id, int depth, const QStringList &propertyNames);
++ uint populate(int id, int depth, const QStringList &propertyNames, const QDBusPlatformMenu *topLevelMenu);
+ void populate(const QDBusPlatformMenu *menu, int depth, const QStringList &propertyNames);
+ void populate(const QDBusPlatformMenuItem *item, int depth, const QStringList &propertyNames);
+
+--- a/src/platformsupport/dbusmenu/qdbusplatformmenu.cpp
++++ b/src/platformsupport/dbusmenu/qdbusplatformmenu.cpp
+@@ -41,9 +41,7 @@
+ Q_LOGGING_CATEGORY(qLcMenu, "qt.qpa.menu")
+
+ static int nextDBusID = 1;
+-QHash<int, QDBusPlatformMenu *> menusByID;
+ QHash<int, QDBusPlatformMenuItem *> menuItemsByID;
+-QList<QDBusPlatformMenu *> QDBusPlatformMenu::m_topLevelMenus;
+
+ QDBusPlatformMenuItem::QDBusPlatformMenuItem(quintptr tag)
+ : m_tag(tag ? tag : reinterpret_cast<quintptr>(this)) // QMenu will overwrite this later
+@@ -85,7 +83,11 @@
+ */
+ void QDBusPlatformMenuItem::setMenu(QPlatformMenu *menu)
+ {
+- m_subMenu = static_cast<QDBusPlatformMenu *>(menu);
++ if (m_subMenu)
++ static_cast<QDBusPlatformMenu *>(m_subMenu)->setContainingMenuItem(Q_NULLPTR);
++ m_subMenu = menu;
++ if (menu)
++ static_cast<QDBusPlatformMenu *>(menu)->setContainingMenuItem(this);
+ }
+
+ void QDBusPlatformMenuItem::setEnabled(bool enabled)
+@@ -130,7 +132,11 @@
+
+ QDBusPlatformMenuItem *QDBusPlatformMenuItem::byId(int id)
+ {
+- return menuItemsByID[id];
++ // We need to check contains because otherwise QHash would insert
++ // a default-constructed nullptr value into menuItemsByID
++ if (menuItemsByID.contains(id))
++ return menuItemsByID[id];
++ return Q_NULLPTR;
+ }
+
+ QList<const QDBusPlatformMenuItem *> QDBusPlatformMenuItem::byIds(const QList<int> &ids)
+@@ -149,18 +155,13 @@
+ , m_isEnabled(false)
+ , m_isVisible(true)
+ , m_isSeparator(false)
+- , m_dbusID(nextDBusID++)
+- , m_revision(0)
++ , m_revision(1)
++ , m_containingMenuItem(Q_NULLPTR)
+ {
+- menusByID.insert(m_dbusID, this);
+- // Assume it's top-level until we find out otherwise
+- m_topLevelMenus << this;
+ }
+
+ QDBusPlatformMenu::~QDBusPlatformMenu()
+ {
+- menusByID.remove(m_dbusID);
+- m_topLevelMenus.removeOne(this);
+ }
+
+ void QDBusPlatformMenu::insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before)
+@@ -174,38 +175,59 @@
+ else
+ m_items.insert(idx, item);
+ m_itemsByTag.insert(item->tag(), item);
+- // If a menu is found as a submenu under an item, we know that it's not a top-level menu.
+ if (item->menu())
+- m_topLevelMenus.removeOne(const_cast<QDBusPlatformMenu *>(static_cast<const QDBusPlatformMenu *>(item->menu())));
++ syncSubMenu(static_cast<const QDBusPlatformMenu *>(item->menu()));
++ emitUpdated();
+ }
+
+ void QDBusPlatformMenu::removeMenuItem(QPlatformMenuItem *menuItem)
+ {
+- m_items.removeAll(static_cast<QDBusPlatformMenuItem *>(menuItem));
++ QDBusPlatformMenuItem *item = static_cast<QDBusPlatformMenuItem *>(menuItem);
++ m_items.removeAll(item);
+ m_itemsByTag.remove(menuItem->tag());
++ if (item->menu()) {
++ // disconnect from the signals we connected to in syncSubMenu()
++ const QDBusPlatformMenu *menu = static_cast<const QDBusPlatformMenu *>(item->menu());
++ disconnect(menu, &QDBusPlatformMenu::propertiesUpdated,
++ this, &QDBusPlatformMenu::propertiesUpdated);
++ disconnect(menu, &QDBusPlatformMenu::updated,
++ this, &QDBusPlatformMenu::updated);
++ }
++ emitUpdated();
++}
++
++void QDBusPlatformMenu::syncSubMenu(const QDBusPlatformMenu *menu)
++{
++ // The adaptor is only connected to the propertiesUpdated signal of the top-level
++ // menu, so the submenus should transfer their signals to their parents.
++ connect(menu, &QDBusPlatformMenu::propertiesUpdated,
++ this, &QDBusPlatformMenu::propertiesUpdated, Qt::UniqueConnection);
++ connect(menu, &QDBusPlatformMenu::updated,
++ this, &QDBusPlatformMenu::updated, Qt::UniqueConnection);
+ }
+
+ void QDBusPlatformMenu::syncMenuItem(QPlatformMenuItem *menuItem)
+ {
++ QDBusPlatformMenuItem *item = static_cast<QDBusPlatformMenuItem *>(menuItem);
++ // if a submenu was added to this item, we need to connect to its signals
++ if (item->menu())
++ syncSubMenu(static_cast<const QDBusPlatformMenu *>(item->menu()));
+ // TODO keep around copies of the QDBusMenuLayoutItems so they can be updated?
+ // or eliminate them by putting dbus streaming operators in this class instead?
+ // or somehow tell the dbusmenu client that something has changed, so it will ask for properties again
+- emitUpdated();
+ QDBusMenuItemList updated;
+ QDBusMenuItemKeysList removed;
+- updated << QDBusMenuItem(static_cast<QDBusPlatformMenuItem *>(menuItem));
++ updated << QDBusMenuItem(item);
+ qCDebug(qLcMenu) << updated;
+ emit propertiesUpdated(updated, removed);
+ }
+
+-QDBusPlatformMenu *QDBusPlatformMenu::byId(int id)
+-{
+- return menusByID[id];
+-}
+-
+ void QDBusPlatformMenu::emitUpdated()
+ {
+- emit updated(++m_revision, m_dbusID);
++ if (m_containingMenuItem)
++ emit updated(++m_revision, m_containingMenuItem->dbusID());
++ else
++ emit updated(++m_revision, 0);
+ }
+
+ void QDBusPlatformMenu::setTag(quintptr tag)
+@@ -233,6 +255,11 @@
+ m_isVisible = isVisible;
+ }
+
++void QDBusPlatformMenu::setContainingMenuItem(QDBusPlatformMenuItem *item)
++{
++ m_containingMenuItem = item;
++}
++
+ QPlatformMenuItem *QDBusPlatformMenu::menuItemAt(int position) const
+ {
+ return m_items.at(position);
+--- a/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h
++++ b/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h
+@@ -119,6 +119,7 @@
+ ~QDBusPlatformMenu();
+ void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) Q_DECL_OVERRIDE;
+ void removeMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
++ void syncSubMenu(const QDBusPlatformMenu *menu);
+ void syncMenuItem(QPlatformMenuItem *menuItem) Q_DECL_OVERRIDE;
+ void syncSeparatorsCollapsible(bool enable) Q_DECL_OVERRIDE { Q_UNUSED(enable); }
+
+@@ -133,8 +134,7 @@
+ void setMinimumWidth(int width) Q_DECL_OVERRIDE { Q_UNUSED(width); }
+ void setFont(const QFont &font) Q_DECL_OVERRIDE { Q_UNUSED(font); }
+ void setMenuType(MenuType type) Q_DECL_OVERRIDE { Q_UNUSED(type); }
+-
+- int dbusID() const { return m_dbusID; }
++ void setContainingMenuItem(QDBusPlatformMenuItem *item);
+
+ void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) Q_DECL_OVERRIDE
+ {
+@@ -155,9 +155,6 @@
+
+ bool operator==(const QDBusPlatformMenu& other) { return m_tag == other.m_tag; }
+
+- static QDBusPlatformMenu* byId(int id);
+- static QList<QDBusPlatformMenu *> topLevelMenus() { return m_topLevelMenus; }
+-
+ uint revision() const { return m_revision; }
+
+ void emitUpdated();
+@@ -173,12 +170,10 @@
+ bool m_isEnabled;
+ bool m_isVisible;
+ bool m_isSeparator;
+- int m_dbusID;
+ uint m_revision;
+ QHash<quintptr, QDBusPlatformMenuItem *> m_itemsByTag;
+ QList<QDBusPlatformMenuItem *> m_items;
+ QDBusPlatformMenuItem *m_containingMenuItem;
+- static QList<QDBusPlatformMenu *> m_topLevelMenus;
+ };
+
+ QT_END_NAMESPACE
diff --git a/debian/patches/dbustray_fixes.diff b/debian/patches/dbustray_fixes.diff
new file mode 100644
index 0000000..d75b0e5
--- /dev/null
+++ b/debian/patches/dbustray_fixes.diff
@@ -0,0 +1,80 @@
+Description: dbustray: support late registering of tray icon menu
+Origin: upstream,
+ https://code.qt.io/cgit/qt/qtbase.git/commit/?id=7ad930987da7bb1d
+ https://code.qt.io/cgit/qt/qtbase.git/commit/?id=a4fac65938fdee74
+Last-Update: 2016-02-20
+
+--- a/src/platformsupport/dbusmenu/qdbusmenuconnection.cpp
++++ b/src/platformsupport/dbusmenu/qdbusmenuconnection.cpp
+@@ -80,6 +80,14 @@
+ }
+
+ #ifndef QT_NO_SYSTEMTRAYICON
++bool QDBusMenuConnection::registerTrayIconMenu(QDBusTrayIcon *item)
++{
++ bool success = connection().registerObject(MenuBarPath, item->menu());
++ if (!success) // success == false is normal, because the object may be already registered
++ qCDebug(qLcMenu) << "failed to register" << item->instanceId() << MenuBarPath;
++ return success;
++}
++
+ bool QDBusMenuConnection::registerTrayIcon(QDBusTrayIcon *item)
+ {
+ bool success = connection().registerService(item->instanceId());
+@@ -95,14 +103,8 @@
+ return false;
+ }
+
+- if (item->menu()) {
+- success = connection().registerObject(MenuBarPath, item->menu());
+- if (!success) {
+- unregisterTrayIcon(item);
+- qWarning() << "failed to register" << item->instanceId() << MenuBarPath;
+- return false;
+- }
+- }
++ if (item->menu())
++ registerTrayIconMenu(item);
+
+ QDBusMessage registerMethod = QDBusMessage::createMethodCall(
+ StatusNotifierWatcherService, StatusNotifierWatcherPath, StatusNotifierWatcherService,
+--- a/src/platformsupport/dbusmenu/qdbusmenuconnection_p.h
++++ b/src/platformsupport/dbusmenu/qdbusmenuconnection_p.h
+@@ -65,6 +65,7 @@
+ QDBusConnection connection() const { return m_connection; }
+ bool isStatusNotifierHostRegistered() const { return m_statusNotifierHostRegistered; }
+ #ifndef QT_NO_SYSTEMTRAYICON
++ bool registerTrayIconMenu(QDBusTrayIcon *item);
+ bool registerTrayIcon(QDBusTrayIcon *item);
+ bool unregisterTrayIcon(QDBusTrayIcon *item);
+ #endif // QT_NO_SYSTEMTRAYICON
+--- a/src/platformsupport/dbustray/qdbustrayicon.cpp
++++ b/src/platformsupport/dbustray/qdbustrayicon.cpp
+@@ -184,16 +184,13 @@
+
+ QPlatformMenu *QDBusTrayIcon::createMenu() const
+ {
+- qCDebug(qLcTray);
+- QDBusPlatformMenu *ret = new QDBusPlatformMenu();
+- if (!m_menu)
+- const_cast<QDBusTrayIcon *>(this)->m_menu = ret;
+- return ret;
++ return new QDBusPlatformMenu();
+ }
+
+ void QDBusTrayIcon::updateMenu(QPlatformMenu * menu)
+ {
+ qCDebug(qLcTray) << menu;
++ bool needsRegistering = !m_menu;
+ if (!m_menu)
+ m_menu = qobject_cast<QDBusPlatformMenu *>(menu);
+ if (!m_menuAdaptor) {
+@@ -205,6 +202,8 @@
+ m_menuAdaptor, SIGNAL(LayoutUpdated(uint,int)));
+ }
+ m_menu->emitUpdated();
++ if (needsRegistering)
++ dBusConnection()->registerTrayIconMenu(this);
+ }
+
+ void QDBusTrayIcon::showMessage(const QString &title, const QString &msg, const QIcon &icon,
diff --git a/debian/patches/series b/debian/patches/series
index 7e30bb0..0dc6edc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,10 @@
# Backported from upstream
+xcb-fix-yet-another-crash-when-screens-are-disconnec.patch
+Prefer-QT_PLUGIN_PATH-over-compiled-in-paths.patch
+Fix-falsely-reported-style-for-fallback-font.patch
+Remove-historical-4-padding-in-QFontEngine-alphaMapF.patch
+dbusmenu_fixes.diff
+dbustray_fixes.diff
no_dbus_dependency.diff
qnativesocketengine_freebsd.diff
qt_functions_missing_eval.diff
diff --git a/debian/patches/xcb-fix-yet-another-crash-when-screens-are-disconnec.patch b/debian/patches/xcb-fix-yet-another-crash-when-screens-are-disconnec.patch
new file mode 100644
index 0000000..e5ded03
--- /dev/null
+++ b/debian/patches/xcb-fix-yet-another-crash-when-screens-are-disconnec.patch
@@ -0,0 +1,32 @@
+From d72da0b4b2ee089156d1bd614523838b1635bbf5 Mon Sep 17 00:00:00 2001
+From: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
+Date: Fri, 4 Sep 2015 13:27:48 +0200
+Subject: [PATCH] xcb: fix yet another crash when screens are disconnected
+
+Can't assume that m_screens is not an empty list.
+
+Task-number: QTBUG-42985
+Change-Id: I6f9422638c219123dc898813910d03c7afbd1450
+Reviewed-by: Uli Schlachter <psychon@znc.in>
+Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
+---
+ src/plugins/platforms/xcb/qxcbconnection.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
++++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
+@@ -1288,10 +1288,12 @@
+ memset(&event, 0, sizeof(event));
+
+ const xcb_window_t eventListener = xcb_generate_id(m_connection);
++ xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup);
++ xcb_screen_t *screen = it.data;
+ Q_XCB_CALL(xcb_create_window(m_connection, XCB_COPY_FROM_PARENT,
+- eventListener, m_screens.at(0)->root(),
++ eventListener, screen->root,
+ 0, 0, 1, 1, 0, XCB_WINDOW_CLASS_INPUT_ONLY,
+- m_screens.at(0)->screen()->root_visual, 0, 0));
++ screen->root_visual, 0, 0));
+
+ event.response_type = XCB_CLIENT_MESSAGE;
+ event.format = 32;
diff --git a/debian/rules b/debian/rules
index 470424e..5d221c5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -222,7 +222,7 @@ override_dh_auto_build-arch:
# regenerate some upstream-provided files.
cd $(CURDIR)/src; ../bin/qmake; make sub-corelib
# Add here the code to generate the helpers and then the headers.
- sh debian/generateTLDs.sh
+ LC_ALL=C.UTF-8 sh debian/generateTLDs.sh
# Clean up the compiled code and start again.
cd $(CURDIR)/src; make distclean
make clean