summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/dbusmenu
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-192-3/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| * dbustray: Use separate D-Bus connections for each tray iconDmitry Shachnev2016-05-122-3/+4
| | | | | | | | | | | | | | | | | | This allows applications to use two or more QSystemTrayIcons. Task-number: QTBUG-53021 Change-Id: I520db99c1c3718906669d1b544d44a8d2f71e1ce Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Add createMenu() method to QPlatformMenuBarDmitry Shachnev2016-03-212-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The D-Bus platform menus are only useful inside menu bars and system tray icons, and should not be created for other cases (like the context menus). This adds a new virtual createMenu() method to QPlatformMenuBar class, analogous to the already existing QPlatformSystemTrayIcon::createMenu() method, and adds support for it to QMenuBar. The D-Bus platform menus are now created from QDBusMenuBar class. As an additional benefit, we no longer have to check whether the AppMenu Registrar service is present for every created menu, and check it only once (this should speed things a bit up). Change-Id: Ic7d94e58a501ab9d2954aeb342ebd46ef8e62d49 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | 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>
* | Add native support for D-Bus global menuDmitry Shachnev2016-02-235-0/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | The protocol was originally developed by Canonical, currently supported by Unity and Plasma. Adjust some tests to use the non-native menu bar when they require it. [ChangeLog][XCB / X11] QMenuBar uses the unified D-Bus AppMenu menubar when the desktop environment supports it. Change-Id: Iea74b40522573bcc4f70168fe7fa2a49b4f3fc21 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-118-68/+155
|\| | | | | | | | | | | | | | | | | | | 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
| * dbustray: Support late registering of tray icon menuDmitry Shachnev2016-02-092-8/+11
| | | | | | | | | | | | | | | | | | If a menu is added to the tray icon after the icon itself has been registered, we need to register the menu properly. Change-Id: I19a6d78848142d66c2cd882746d8d55c0b9a2818 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| * Fix clang 3.7 developer build [Werror, Winconsistent-missing-override]Sérgio Martins2016-02-081-1/+1
| | | | | | | | | | | | Change-Id: Ia5c149c6e6886c38bb9a83cd8b36737a57876b41 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * dbusmenu: Refactor the code to allow dynamic updating of menusDmitry Shachnev2016-02-086-54/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: Fix return type for QDBusMenuAdaptor::EventGroup methodDmitry Shachnev2016-02-032-2/+3
| | | | | | | | | | Change-Id: If7454eeaafb31737f023e7359b2a1c513dd5772f Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| * dbusmenu: Add missing methods for getting QDBusPlatformMenu propertiesDmitry Shachnev2016-02-031-0/+3
| | | | | | | | | | | | | | | | Similar to the existing methods for QDBusPlatformMenuItem. These methods will be needed for implementing the D-Bus platform menu bar. Change-Id: Iae3a5892b71fa9a7c72c323ee4b3ab2afd7d4d76 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| * dbusmenu: Add support for shortcutsDmitry Shachnev2016-02-022-4/+36
| | | | | | | | | | | | | | | | | | | | To do that, split out and export a QKeySequencePrivate::keyName() function that returns the key text representation without the modifiers. The implementation is compatible with libdbusmenu-qt. Change-Id: Ibc3190a3949813a1610728cf89574027e5d2778d Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | dbusmenu: Use proper toggle-type for items that are part of groupDmitry Shachnev2016-02-093-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-158-112/+160
|/ | | | | | | | | | | 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>
* Libraries: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | Use character literals where applicable. Change-Id: I8e198774c2247c1cc1d852a41b59b301199b7878 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-052-0/+22
| | | | | Change-Id: If81a5e1db0fe93377e7cc54a78b01c50b44abe57 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-022-0/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * QDBusPlatformMenu and Item: remove stored pointers when deletedShawn Rutledge2015-09-022-0/+7
| | | | | | | | | | | | | | Prevents memory leak and later access of dangling pointers. Change-Id: I6a1da1ec191ad5fa880c5884c37fd5582215e825 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Fix missing "We mean it" in qtbase private headersThiago Macieira2015-10-011-0/+11
| | | | | | | | | | Change-Id: I42e7ef1a481840699a8dffff1408dfd4fd9c8e32 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | platformsupport/dbusmenu: fix uses of inefficient QListsMarc Mutz2015-07-191-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | These types are larger than a void*, so holding them in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking them movable, and holding in a QVector instead. Change-Id: I74b2ce327d6aee60e2cc3463ce09453a4305bba7 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use QList::reserve(), reduces reallocationsSérgio Martins2015-06-271-0/+1
|/ | | | | Change-Id: I9f218bdd65a97ad9c867b695f3ba27ab64a54d2a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* D-Bus system tray icon: submenus can be created after context menuShawn Rutledge2015-05-212-2/+11
| | | | | | | | | | | | | | | | | | | | 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-304-24/+33
| | | | | | | | | 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>
* D-Bus system tray: properly check whether StatusNotifierHost availableShawn Rutledge2015-02-202-7/+7
| | | | | | | | | | | | | | | | "org.kde.StatusNotifierWatcher" is just a watcher/helper, whereas the actual systray object is "org.kde.StatusNotifierHost-$PID". The org.kde.StatusNotifierWatcher.IsStatusNotifierHostRegistered property can tell us whether there is an actual system tray. Also renamed the accessor to isStatusNotifierHostRegistered since we are checking for the host, and also because it can be confusing that it's a member of QDBusMenuConnection if the name isn't clear. See also KDE bug 339707 Change-Id: I218c5357b9cc5a62e5cc07abe980893b826f98f4 Reviewed-by: Martin Klapetek <mklapetek@kde.org> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
* Update copyright headersJani Heikkinen2015-02-118-56/+56
| | | | | | | | | | | | | | | | | | 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>
* Get rid of Q_GUI_EXPORT occurrences in QPlatformSupportKonstantin Ritt2015-01-231-2/+2
| | | | | | | | | This fixes GCC warning on MinGW, when built with -Wattribute (the default) Change-Id: I8e2b56a4a8fe9db0ec821f346a523b670df80f85 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* QSystemTrayIcon uses D-Bus StatusNotifier on Linux when possibleShawn Rutledge2015-01-229-0/+1338
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>