summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/dbustray
Commit message (Collapse)AuthorAgeFilesLines
* D-Bus system tray: emit activated on middle and right clickShawn Rutledge2015-03-313-20/+10
| | | | | | | | | | | | | | | The ActivationReason provides the type of click. If the icon has a D-Bus menu, then QStatusNotifierItemAdaptor::ContextMenu will not be called: the tray is responsible for opening the context menu. But an application can alternatively do something different with a right-click by not providing a menu, and instead handling the QSystemTrayIcon::activated signal with the Context reason. Simplified the code by emitting the signal directly in QStatusNotifierItemAdaptor. Task-number: QTBUG-44929 Change-Id: Ia062a9a2fd99554418d58a1ff6ecd4e862035198 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* D-Bus system tray: emit QPlatformSystemTrayIcon::activated on clickShawn Rutledge2015-03-311-1/+1
| | | | | | | | | | | This was incomplete functionality in 38abd653774aa0b3c5cdfd9a8b78619605230726 Task-number: QTBUG-44929 Change-Id: I7120a3de011c5df57ef5a9fbdfe056eee42d572b Reviewed-by: Marco Martin <mart@kde.org> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* D-Bus tray icon menus: support submenusShawn Rutledge2015-03-301-2/+3
| | | | | | | | | 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>
* Do not attempt to unregister an unregistered dbus serviceAllan Sandfeld Jensen2015-02-202-2/+6
| | | | | | | | | | | If a QSystemTrayIcon is created but never shown, it will trigger a warning on exit when it fails to unregister. This patch ensures we only try to unregister if the service was registered in the first place. Change-Id: I0e245d19be55c58aea180dbcbe5215e738d05280 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* D-Bus system tray: properly check whether StatusNotifierHost availableShawn Rutledge2015-02-201-5/+2
| | | | | | | | | | | | | | | | "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>
* D-Bus tray icons: save temp file with size 22pxShawn Rutledge2015-02-081-5/+1
| | | | | | | | Gnome Classic on Ubuntu shows this icon but fails to scale it down. So if we do not pre-scale the icon, it will be too wide, and cropped. Change-Id: If8cf98de3672deff77b99b17da5491bd6c45cfdb Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* D-Bus tray icons: get devicePixelRatio at runtimeShawn Rutledge2015-02-041-8/+9
| | | | | | | | | | | In static builds of Qt, static initialization may not work because we need an initialized list of screens before devicePixelRatio() can use them to find the value. Anyway, it's better to know the dpr at the time the tray icon will be shown rather than when the application is started, just in case it changes. Change-Id: Iedffb674d8e8818c2a4e64d7c7a3c89a2dca77f3 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* D-Bus tray icons: make endian conversion work againShawn Rutledge2015-01-232-8/+10
| | | | | | | | | Endian conversion needs to be done on aligned data, but the data is stored unaligned in the QByteArray. So the new qFromUnaligned() function is needed. Change-Id: I12f9e52cea81d06129b306709bb9d2cd004f04e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* D-Bus tray icon: when eliminating large icons, scale to medium sizeShawn Rutledge2015-01-231-5/+12
| | | | | | | | | 22px is not always large enough: KDE5 seems to like to make icons up to 28px, and they could be even larger on high-DPI screens. Change-Id: Ifa8e0d49b310e4b4304207596f0f32c36a5db6a7 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* D-Bus tray icon: ensure that the image is square before sendingShawn Rutledge2015-01-231-6/+17
| | | | | | | | | Sometimes KDE doesn't render non-square icons properly when they have been received over the D-Bus protocol. Change-Id: Icc6fa3d64a1598ea8f719192ae18d32f287d6a79 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* QSystemTrayIcon uses D-Bus org.freedesktop.Notifications on LinuxShawn Rutledge2015-01-235-1/+226
| | | | | | | | | | | | If StatusNotifier is working, then QSystemTrayIcon::showMessage() will send notifications using the org.freedesktop.Notifications protocol. https://developer.gnome.org/notification-spec/ Task-number: QTBUG-4011 Task-number: QTBUG-31762 Change-Id: Ia1925ec3dd81b1b7b8f3b490b6364aaf8f93f395 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* QSystemTrayIcon uses D-Bus StatusNotifier on Linux when possibleShawn Rutledge2015-01-227-11/+831
| | | | | | | | | | | | | | | | | | | | | 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>
* Add D-Bus types marshalling for Linux tray icon supportMarco Martin2015-01-122-0/+244
Add marshalling for icon pixmaps to be used in DBus tray icon support according to the specification http://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/Icons/ Task-number: QTBUG-31762 Change-Id: I16e66c272eef413a7c94345c273e5fd3a8c0f771 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>