[SCM] qtbase packaging branch, ubuntu, updated. ubuntu/5.7.1+dfsg-2ubuntu1-4-geb838b9

Dmitry Shachnev mitya57 at moszumanska.debian.org
Wed Jan 25 17:43:04 UTC 2017


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

The following commit has been merged in the ubuntu branch:
commit eb838b990d5c798e411f5bff754760b10d7be62e
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date:   Wed Jan 25 20:41:49 2017 +0300

    Backport upstream change to make shortcuts working with global menus.
    
    LP: #1380702.
---
 debian/changelog                          |  7 ++++
 debian/patches/global_menu_shortcuts.diff | 55 +++++++++++++++++++++++++++++++
 debian/patches/series                     |  1 +
 3 files changed, 63 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 26fe40e..ee8327b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+qtbase-opensource-src (5.7.1+dfsg-2ubuntu3) UNRELEASED; urgency=medium
+
+  * Backport upstream change to make shortcuts working with global menu
+    on Unity (global_menu_shortcuts.diff, LP: #1380702).
+
+ -- Dmitry Shachnev <mitya57 at ubuntu.com>  Wed, 25 Jan 2017 20:38:18 +0300
+
 qtbase-opensource-src (5.7.1+dfsg-2ubuntu2~1) zesty; urgency=medium
 
   * Disable gold linker also on arm64 and ppc64el (LP: #1656431)
diff --git a/debian/patches/global_menu_shortcuts.diff b/debian/patches/global_menu_shortcuts.diff
new file mode 100644
index 0000000..c433286
--- /dev/null
+++ b/debian/patches/global_menu_shortcuts.diff
@@ -0,0 +1,55 @@
+Description: make shortcuts work for platform menu bars
+ When a platform menu bar is used, the QMenuBar is hidden, so shortcuts
+ for QActions attached only to it do not work.
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=287f548d4c7cc594
+Bug: https://bugs.launchpad.net/bugs/1380702
+Last-Update: 2017-01-25
+
+--- a/src/widgets/kernel/qshortcut.cpp
++++ b/src/widgets/kernel/qshortcut.cpp
+@@ -141,9 +141,11 @@
+ static bool correctWidgetContext(Qt::ShortcutContext context, QWidget *w, QWidget *active_window)
+ {
+     bool visible = w->isVisible();
+-#ifdef Q_OS_MAC
+-    if (!qApp->testAttribute(Qt::AA_DontUseNativeMenuBar) && qobject_cast<QMenuBar *>(w))
+-        visible = true;
++#ifndef QT_NO_MENUBAR
++    if (QMenuBar *menuBar = qobject_cast<QMenuBar *>(w)) {
++        if (menuBar->isNativeMenuBar())
++            visible = true;
++    }
+ #endif
+ 
+     if (!visible || !w->isEnabled())
+--- a/src/widgets/widgets/qmenubar.cpp
++++ b/src/widgets/widgets/qmenubar.cpp
+@@ -1288,10 +1288,12 @@
+     } else if(e->type() == QEvent::ActionRemoved) {
+         e->action()->disconnect(this);
+     }
+-    if (isVisible()) {
++    // updateGeometries() is also needed for native menu bars because
++    // it updates shortcutIndexMap
++    if (isVisible() || isNativeMenuBar())
+         d->updateGeometries();
++    if (isVisible())
+         update();
+-    }
+ }
+ 
+ /*!
+@@ -1708,6 +1710,13 @@
+ {
+     Q_Q(QMenuBar);
+     QAction *act = actions.at(id);
++    if (act && act->menu()) {
++        if (QPlatformMenu *platformMenu = act->menu()->platformMenu()) {
++            platformMenu->showPopup(q->windowHandle(), actionRects.at(id), Q_NULLPTR);
++            return;
++        }
++    }
++
+     setCurrentAction(act, true, true);
+     if (act && !act->menu()) {
+         activateAction(act, QAction::Trigger);
diff --git a/debian/patches/series b/debian/patches/series
index 945c844..a4b0e1f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,6 +8,7 @@ Merge-the-QDBusMetaType-s-custom-information-to-QDBu.patch
 Fix-some-QtDBus-crashes-during-application-destructi.patch
 Make-the-bearer-QFactoryLoader-a-member-variable-not.patch
 Stop-unloading-plugins-in-QPluginLoader-and-QFactory.patch
+global_menu_shortcuts.diff
 
 # Debian specific.
 no_dbus_dependency.diff

-- 
qtbase packaging



More information about the pkg-kde-commits mailing list