[SCM] qtbase packaging branch, experimental, updated. debian/5.4.1+dfsg-2-13-gbfd9df9

Lisandro Damián Nicanor Pérez lisandro at moszumanska.debian.org
Wed May 13 15:14:47 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/qt/qtbase.git;a=commitdiff;h=bfd9df9

The following commit has been merged in the experimental branch:
commit bfd9df9cfe6658762ec1da1b9e25995bbe33742f
Author: Lisandro Damián Nicanor Pérez Meyer <perezmeyer at gmail.com>
Date:   Wed May 13 12:14:27 2015 -0300

    Fix system tray bugs.
---
 debian/changelog                                   |  4 +
 ...tsystemtrayicon_handle_submenus_correctly.patch | 88 ++++++++++++++++++++++
 debian/patches/series                              |  3 +
 ...ing_tray_icon_window_until_it_is_embedded.patch | 50 ++++++++++++
 4 files changed, 145 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index df77323..daa9d3d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,10 @@ qtbase-opensource-src (5.4.1+dfsg-3) UNRELEASED; urgency=medium
   * Use pkgkde-mark-private-symbols instead of mark_private_symbols.sh.
     - Remove the previous script from the package.
     - Depend on pkg-kde-tools >= 0.15.17.
+  * Fix system tray's bugs with:
+    - xcb_delay_showing_tray_icon_window_until_it_is_embedded.patch
+      (Closes: #775398)
+    - qtsystemtrayicon_handle_submenus_correctly.patch
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Thu, 05 Mar 2015 10:26:29 +0300
 
diff --git a/debian/patches/qtsystemtrayicon_handle_submenus_correctly.patch b/debian/patches/qtsystemtrayicon_handle_submenus_correctly.patch
new file mode 100644
index 0000000..93b92ce
--- /dev/null
+++ b/debian/patches/qtsystemtrayicon_handle_submenus_correctly.patch
@@ -0,0 +1,88 @@
+From 03dc2b2e82750d1c531cf00a406368cde4a8928b Mon Sep 17 00:00:00 2001
+From: Dmitry Shachnev <mitya57 at gmail.com>
+Date: Sun, 11 Jan 2015 12:05:55 +0300
+Subject: [PATCH] QSystemTrayIcon: handle submenus correctly
+
+This fixes a bug when submenus are shown as simple actions when
+a platform system tray icon is used.
+
+To correctly handle submenus, we need to set platform menus on
+all submenus, and only then on a parent menu.
+
+Change-Id: If2bfcc703b938dbb14ba4b9aa810039ced07e946
+Reviewed-by: Friedemann Kleint <Friedemann.Kleint at theqtcompany.com>
+Reviewed-by: Dimitrios Glentadakis <dglent at free.fr>
+Reviewed-by: Shawn Rutledge <shawn.rutledge at digia.com>
+---
+ src/widgets/util/qsystemtrayicon.cpp | 28 +++++++++++++++++++++++-----
+ src/widgets/util/qsystemtrayicon_p.h |  1 +
+ 2 files changed, 24 insertions(+), 5 deletions(-)
+
+diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
+index 7d04cab..d151e57 100644
+--- a/src/widgets/util/qsystemtrayicon.cpp
++++ b/src/widgets/util/qsystemtrayicon.cpp
+@@ -37,6 +37,7 @@
+ #ifndef QT_NO_SYSTEMTRAYICON
+ 
+ #include "qmenu.h"
++#include "qlist.h"
+ #include "qevent.h"
+ #include "qpoint.h"
+ #include "qlabel.h"
+@@ -704,11 +705,7 @@ void QSystemTrayIconPrivate::updateIcon_sys_qpa()
+ void QSystemTrayIconPrivate::updateMenu_sys_qpa()
+ {
+     if (menu) {
+-        if (!menu->platformMenu()) {
+-            QPlatformMenu *platformMenu = qpa_sys->createMenu();
+-            if (platformMenu)
+-                menu->setPlatformMenu(platformMenu);
+-        }
++        addPlatformMenu(menu);
+         qpa_sys->updateMenu(menu->platformMenu());
+     }
+ }
+@@ -741,6 +738,27 @@ void QSystemTrayIconPrivate::showMessage_sys_qpa(const QString &message,
+                      static_cast<QPlatformSystemTrayIcon::MessageIcon>(icon), msecs);
+ }
+ 
++void QSystemTrayIconPrivate::addPlatformMenu(QMenu *menu) const
++{
++    if (menu->platformMenu())
++        return; // The platform menu already exists.
++
++    // The recursion depth is the same as menu depth, so should not
++    // be higher than 3 levels.
++    QListIterator<QAction *> it(menu->actions());
++    while (it.hasNext()) {
++        QAction *action = it.next();
++        if (action->menu())
++            addPlatformMenu(action->menu());
++    }
++
++    // This menu should be processed *after* its children, otherwise
++    // setMenu() is not called on respective QPlatformMenuItems.
++    QPlatformMenu *platformMenu = qpa_sys->createMenu();
++    if (platformMenu)
++        menu->setPlatformMenu(platformMenu);
++}
++
+ QT_END_NAMESPACE
+ 
+ #endif // QT_NO_SYSTEMTRAYICON
+diff --git a/src/widgets/util/qsystemtrayicon_p.h b/src/widgets/util/qsystemtrayicon_p.h
+index 0dda689..f05bf9e 100644
+--- a/src/widgets/util/qsystemtrayicon_p.h
++++ b/src/widgets/util/qsystemtrayicon_p.h
+@@ -99,6 +99,7 @@ private:
+     void updateMenu_sys_qpa();
+     QRect geometry_sys_qpa() const;
+     void showMessage_sys_qpa(const QString &msg, const QString &title, QSystemTrayIcon::MessageIcon icon, int secs);
++    void addPlatformMenu(QMenu *menu) const;
+ };
+ 
+ class QBalloonTip : public QWidget
+-- 
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
index a7d9be1..8bcbfd2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,10 @@
+# Backported stuff
 upstream_small-improvements-to-the-hurd-g-mkspec.patch
 upstream_Complete-MIPS-atomic-support-on-pre-MIPS32-architect.patch
 gnukfreebsd.diff
 cve-2015-0295.diff
+qtsystemtrayicon_handle_submenus_correctly.patch
+xcb_delay_showing_tray_icon_window_until_it_is_embedded.patch
 
 # Debian specific.
 revert_upstream_bsymbolic_change.patch
diff --git a/debian/patches/xcb_delay_showing_tray_icon_window_until_it_is_embedded.patch b/debian/patches/xcb_delay_showing_tray_icon_window_until_it_is_embedded.patch
new file mode 100644
index 0000000..5aa100e
--- /dev/null
+++ b/debian/patches/xcb_delay_showing_tray_icon_window_until_it_is_embedded.patch
@@ -0,0 +1,50 @@
+From 612953a626ec21b8518ee23a4f5268b566cf41e5 Mon Sep 17 00:00:00 2001
+From: Shawn Rutledge <shawn.rutledge at digia.com>
+Date: Thu, 29 Jan 2015 16:22:08 +0100
+Subject: [PATCH] xcb: delay showing tray icon window until it is embedded
+
+Otherwise there is a race condition: when the tray implementation
+gets around to embedding the window, if it was already shown,
+it will be unmapped, embedded, and then remapped. Some tray
+implementations will resize the tray icon to 1 pixel wide in
+that case. We also never want to show a window that was intended
+for the tray in any other location, so it's better that it remain
+invisible until we are sure it is embedded.
+
+Task-number: QTBUG-31762
+Task-number: QTBUG-35658
+Task-number: QTBUG-32811
+Change-Id: Id324b0bfded0f8258ff1686a223cb2c069827d42
+Reviewed-by: Laszlo Agocs <laszlo.agocs at theqtcompany.com>
+---
+ src/plugins/platforms/xcb/qxcbwindow.cpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
+index 4fd71f1..96c5663 100644
+--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
++++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
+@@ -755,6 +755,9 @@ void QXcbWindow::show()
+     if (connection()->time() != XCB_TIME_CURRENT_TIME)
+         updateNetWmUserTime(connection()->time());
+ 
++    if (window()->objectName() == QLatin1String("QSystemTrayIconSysWindow"))
++        return; // defer showing until XEMBED_EMBEDDED_NOTIFY
++
+     Q_XCB_CALL(xcb_map_window(xcb_connection(), m_window));
+ 
+     if (QGuiApplication::modalWindow() == window())
+@@ -2338,7 +2341,10 @@ void QXcbWindow::handleXEmbedMessage(const xcb_client_message_event_t *event)
+     switch (event->data.data32[1]) {
+     case XEMBED_WINDOW_ACTIVATE:
+     case XEMBED_WINDOW_DEACTIVATE:
++        break;
+     case XEMBED_EMBEDDED_NOTIFY:
++        Q_XCB_CALL(xcb_map_window(xcb_connection(), m_window));
++        m_screen->windowShown(this);
+         break;
+     case XEMBED_FOCUS_IN:
+         Qt::FocusReason reason;
+-- 
+2.1.4
+

-- 
qtbase packaging



More information about the pkg-kde-commits mailing list