Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Leap:42.3:Rings:1-MinimalX
libqt5-qtbase
qdbusmenu-Map-showPopup-method-to-ItemActivatio...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File qdbusmenu-Map-showPopup-method-to-ItemActivationRequested.patch of Package libqt5-qtbase
From 3e31b71b9ca859cad8823a9d8d19063dd14be809 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev <mitya57@gmail.com> Date: Wed, 2 Nov 2016 20:40:12 +0300 Subject: [PATCH] dbusmenu: Map showPopup method to ItemActivationRequested signal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way the Qt accelerator shortcuts (i.e. Alt+F for the File menu) will cause the matching menu to be opened on the server side. Change-Id: I02a5b3c20c6eae130d0f133b33c9e247cff38d44 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> --- .../themes/genericunix/dbusmenu/qdbusmenubar.cpp | 2 ++ .../themes/genericunix/dbusmenu/qdbusplatformmenu.cpp | 14 ++++++++++++++ .../themes/genericunix/dbusmenu/qdbusplatformmenu_p.h | 9 ++------- 3 files changed, 18 insertions(+), 7 deletions(-) --- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar.cpp +++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar.cpp @@ -59,6 +59,8 @@ QDBusMenuBar::QDBusMenuBar() m_menuAdaptor, &QDBusMenuAdaptor::ItemsPropertiesUpdated); connect(m_menu, &QDBusPlatformMenu::updated, m_menuAdaptor, &QDBusMenuAdaptor::LayoutUpdated); + connect(m_menu, &QDBusPlatformMenu::popupRequested, + m_menuAdaptor, &QDBusMenuAdaptor::ItemActivationRequested); } QDBusMenuBar::~QDBusMenuBar() --- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp +++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu.cpp @@ -33,6 +33,7 @@ #include "qdbusplatformmenu_p.h" +#include <QDateTime> #include <QDebug> #include <QWindow> @@ -192,6 +193,8 @@ void QDBusPlatformMenu::removeMenuItem(Q this, &QDBusPlatformMenu::propertiesUpdated); disconnect(menu, &QDBusPlatformMenu::updated, this, &QDBusPlatformMenu::updated); + disconnect(menu, &QDBusPlatformMenu::popupRequested, + this, &QDBusPlatformMenu::popupRequested); } emitUpdated(); } @@ -204,6 +207,8 @@ void QDBusPlatformMenu::syncSubMenu(cons this, &QDBusPlatformMenu::propertiesUpdated, Qt::UniqueConnection); connect(menu, &QDBusPlatformMenu::updated, this, &QDBusPlatformMenu::updated, Qt::UniqueConnection); + connect(menu, &QDBusPlatformMenu::popupRequested, + this, &QDBusPlatformMenu::popupRequested, Qt::UniqueConnection); } void QDBusPlatformMenu::syncMenuItem(QPlatformMenuItem *menuItem) @@ -260,6 +265,15 @@ void QDBusPlatformMenu::setContainingMen m_containingMenuItem = item; } +void QDBusPlatformMenu::showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) +{ + Q_UNUSED(parentWindow); + Q_UNUSED(targetRect); + Q_UNUSED(item); + setVisible(true); + emit popupRequested(m_containingMenuItem->dbusID(), QDateTime::currentMSecsSinceEpoch()); +} + QPlatformMenuItem *QDBusPlatformMenu::menuItemAt(int position) const { return m_items.value(position); --- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h +++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusplatformmenu_p.h @@ -150,13 +150,7 @@ public: void setMenuType(MenuType type) Q_DECL_OVERRIDE { Q_UNUSED(type); } void setContainingMenuItem(QDBusPlatformMenuItem *item); - void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) Q_DECL_OVERRIDE - { - Q_UNUSED(parentWindow); - Q_UNUSED(targetRect); - Q_UNUSED(item); - setVisible(true); - } + void showPopup(const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) Q_DECL_OVERRIDE; void dismiss() Q_DECL_OVERRIDE { } // Closes this and all its related menu popups @@ -176,6 +170,7 @@ public: signals: void updated(uint revision, int dbusId); void propertiesUpdated(QDBusMenuItemList updatedProps, QDBusMenuItemKeysList removedProps); + void popupRequested(int id, uint timestamp); private: quintptr m_tag;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor