summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/dbusmenu/qdbusplatformmenu.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-161-0/+4
|\ | | | | | | | | | | | | Conflicts: src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp Change-Id: I0af32ee55936d523cbd259b6fe82eb9c409f9074
| * dbusmenu: Don’t leave dangling pointers when menus are destroyedDmitry Shachnev2016-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | Delete references from menu to its containing item, and vice versa. Fixes https://launchpad.net/bugs/1620937 Task-number: QTBUG-55966 Change-Id: I58f0f0a90184bee4b0466c28d91c670a34fa65a5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-291-1/+1
|\| | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qprocess/tst_qprocess.cpp Change-Id: Ib6955eb874b516b185b45d6c38cec646fbaa95f4
| * Fix QDBusPlatformMenu::menuItemAt()J-P Nurmi2016-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | Other platform menu implementations check that the index is not out of bounds, so make QDBusPlatformMenu::menuItemAt() do the same. Change-Id: I1d2e42681f2dbfff8b80044141d620bddbc3b6aa Task-number: QTBUG-51372 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-111-22/+49
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemwatcher_win.cpp src/corelib/plugin/plugin.pri src/plugins/platforms/cocoa/qcocoaaccessibility.mm tests/auto/corelib/tools/qlocale/tst_qlocale.cpp Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
| * dbusmenu: Refactor the code to allow dynamic updating of menusDmitry Shachnev2016-02-081-22/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Transfer propertiesUpdated and updated signals from submenus to parent menus. Without this, the adaptor only receives this signal from top-level menu items, and doesn't receive it from items of submenus. Connect to these signals when a menu item is added or synced, and disconnect when it is removed. * Make QDBusPlatformMenus use IDs of items containing them, not their own IDs (own IDs do not make any sense since they are not exported over D-Bus). * Store toplevel menus per-adaptor, to make it possible to export multiple menus (for example a menubar and a tray icon menu). * Adjust the QDBusMenuLayoutItem::populate methods to always get the menu via its containing item and to populate the menus recursively. * Map D-Bus menu AboutToShow method to platform menu aboutToShow method, and map hovered and closed events to hovered and aboutToHide signals. (QTBUG-46293) * Always set the visible property on item. Otherwise, when an item becomes visible, the D-Bus menu still thinks it's invisible because that property was not changed back to true. (QTBUG-48647) * Call emitUpdated from insertMenuItem and removeMenuItem methods, as they really update layout. Do not call it from syncMenuItem, it changes only properties but not the layout. * Start revision numbering with 1, because libdbusmenu-based hosts ignore updated signal with revision=1. Task-number: QTBUG-46293 Task-number: QTBUG-48647 Change-Id: Icf713405db0443e25462c1a19046df7689fe5e78 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
* | dbusmenu: Use proper toggle-type for items that are part of groupDmitry Shachnev2016-02-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | To achieve that, add a new virtual setHasExclusiveGroup() method to QPlatformMenuItem class (optional because we don't want to break existing platform themes), call it when converting QActions into platform menu items, and use it when exporting the menu items over D-Bus. Also, send ActionChanged event for actions when their group is changed, so that the platform menus are updated too. Change-Id: I8d951ace8c4097decec2a0154163e3672214effb Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-021-2/+2
|\| | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/compile.test src/plugins/platforms/cocoa/qcocoahelpers.mm src/tools/qlalr/cppgenerator.cpp Change-Id: I0103ca076a9aca7118b2fd99f0fdaf81055998c3
| * dbusmenu: Make D-Bus menus and menu items enabled by defaultDmitry Shachnev2016-01-311-2/+2
| | | | | | | | | | | | | | | | | | There is no reason why they should be disabled, and also the current behavior breaks the D-Bus platform menu bar implementation. Change-Id: I8a8b5b6a66e40f1f1a25394dc87ac2178c7907fa Reviewed-by: Martin Klapetek <mklapetek@kde.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QDBusPlatformMenu and Item: remove stored pointers when deletedShawn Rutledge2015-09-021-0/+6
| | | | | | | Prevents memory leak and later access of dangling pointers. Change-Id: I6a1da1ec191ad5fa880c5884c37fd5582215e825 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* D-Bus system tray icon: submenus can be created after context menuShawn Rutledge2015-05-211-1/+8
| | | | | | | | | | | | | | | | | | | | QMenuPrivate::init() calls QPlatformTheme::createPlatformMenu() to create a platform menu, but on Linux, that returns null for now. QSystemTrayIcon::setContextMenu() results in recursive calls to QSystemTrayIconPrivate::addPlatformMenu() which then calls QDBusTrayIcon::createMenu() for the context menu and each submenu. However if a submenu is added afterwards, a corresponding platform menu is not immediately created. Now copyActionToPlatformItem() will detect and create the missing platform submenu, by calling a new method: DBusPlatformMenu::createSubMenu(). This is because there is no way of knowing that it's a tray-specific context menu (which is so far the only case in which we use DBusPlatformMenu). So, QPlatformMenu::createSubMenu() needs to exist as a new QPA interface for this use case. Task-number: QTBUG-45803 Change-Id: Ib319e873082196515ea0580d70d069099cf2c175 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* D-Bus tray icon menus: support submenusShawn Rutledge2015-03-301-6/+6
| | | | | | | | | In this case GetLayout will be called with the D-Bus menu ID of the menu item which contains the submenu. Task-number: QTBUG-45191 Change-Id: Ia8108272910eac10f040db5865ec4e070da80edb Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QSystemTrayIcon uses D-Bus StatusNotifier on Linux when possibleShawn Rutledge2015-01-221-0/+249
Implementing org.kde.StatusNotifier DBus interface http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/ as well as org.canonical.dbusmenu for the limited purpose of showing the tray icon's context menu. If a desktop environment (such as KDE or Unity) has a StatusNotifierWatcher listening, then tray icon information is sent to be displayed by the tray implementation instead of being rendered directly in an XEmbed window. This is necessary because some modern tray implementations no longer provide XEmbed "hosting". [ChangeLog][QPA][Xcb] QSystemTrayIcon uses StatusNotifier D-Bus protocol when the desktop environment supports it Task-number: QTBUG-31762 Done-with: Marco Martin <mart@kde.org> Change-Id: I3b1f744d621eefc7e9c61d1469460ebfcc77fc54 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>