summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
Commit message (Collapse)AuthorAgeFilesLines
* dbustray: Support replacing menu on QDBusTrayIconDmitry Shachnev2016-10-073-8/+16
| | | | | | | | | If a new menu is set via the updateMenu() method, properly unregister the old menu and register the new one. Task-number: QTBUG-53676 Change-Id: I8c1ea2d171caec01488f0fe8a565bc9b2f7e431e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix Myanmar text with some fontsEskil Abrahamsen Blomfeldt2016-09-231-1/+7
| | | | | | | | | | | | | | | In change db2764db3466221ad680d63ff2224cdd016fc351, we introduced the requirement of having specific OpenType tables available to certain fonts. Before, we would not require OpenType support to use a font for Myanmar text, for instance, since this was not listed as one of the languages requiring OpenType support. This patch simply brings back the limitation that fonts are only disqualified by missing tables if the language is one of the ones we know to require OpenType. Change-Id: I6f1ee2c8a068f9e183a36e24967f331dae96c14b Task-number: QTBUG-55569 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QEvdevKeyboardHandler: use RAII in create()/ctorMarc Mutz2016-09-182-18/+33
| | | | | | | | | | | | | | | | Coverity somewhat rightfully complained that the FD may be leaked in certain cases, e.g. when the new-expression throws. Yes, the plugin is compiled with exceptions disabled, but the code is still a bug waiting to happen, because it's too easy to just add an early return to the function and leak the FD that way. Fix by writing a small RAII class for FDs (can't use QSharedPointer, since it's not a pointer we're dealing with). It's quite generically named, in anticipation that it might come in handy elsewhere, too. Coverity-Id: 89046 Change-Id: I83d1ed3f11219065d2248c129ed191a651f617c7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* 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>
* dbustray: Delete m_notifier in QDBusTrayIcon::cleanup()Dmitry Shachnev2016-09-151-0/+2
| | | | | | | | This fixes a bug where notificationClosed() and actionInvoked() slots were called more than once, from previous alive notifier instances. Change-Id: I4cb4dfc27ee129bc5282fbd8e0961959d0765112 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Cocoa: Add support for triple-buffered GL contextsTor Arne Vestbø2016-08-291-1/+4
| | | | | | | | | As usual, the requested format may not be available, so clients should check the actual format to confirm triple-buffering. Change-Id: Icf073cc9ddf2c912eb5c3ce0ac80d1694d1c56d7 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* AtSpiAdaptor: fix 'defined' field in GetAttributeValueMarc Mutz2016-08-111-2/+1
| | | | | | | | | Value was inverted. Found by own code review. Change-Id: I2027d97e1f9d52f6d79fb72ecad9ee2034f9af25 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* evdevtouch: Avoid crashing on exitLaszlo Agocs2016-08-101-2/+6
| | | | | | | | | | | | | | | 26238aca8c442736f380eb523ef48468f892bdb7 causes double deletion of the QTouchDevice in case the post routine already cleaned up the list by the time the touch handler gets to do it. Just check the list of devices to see if the one we hold is still there. If not, the pointer is likely to be a dangling one so do nothing. This will avoid dying with bus error or similar on application exit. Task-number: QTBUG-51562 Change-Id: I50c1edee7405aad308274538219698388c2cc9f9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* embedded: Make signal handlers optionalLaszlo Agocs2016-07-271-8/+10
| | | | | | | | | | [ChangeLog][Platform Specific Changes] It is now possible to opt out from installing signal handlers when running with eglfs and linuxfb by setting the QT_QPA_NO_SIGNAL_HANDLER environment variable to a non-zero value. Task-number: QTBUG-54733 Change-Id: Ib07d4bbf714c752631c49b76ad0a16677c1ba5bd Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Mac: Read in the string with QString::fromUtf8() as it is UTF8 encodedAndy Shaw2016-07-131-3/+1
| | | | | | | Task-number: QTBUG-47358 Change-Id: I50943867d3a57c4db4fe20e55e60d097742e9104 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: jian liang <jianliang79@gmail.com>
* Remove QCoreTextFontEngine::supportsColorGlyphsGabriel de Dietrich2016-07-063-24/+3
| | | | | | | | This is always true on the versions we currently support. Change-Id: I1aecbbd1f41e0f4f03b380358cd762ca00bb1e97 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* UIKit: Don't populate font families with no matching fontsTor Arne Vestbø2016-06-141-0/+6
| | | | | | | | | | | | | | | | | [UIFont familyNames] will return a list of fonts that include the fonts Telugu Sangam MN, Heiti SC, Heiti TC, and Bangla Sangam MN, but when calling [UIFont fontNamesForFamilyName:] for these fonts we get an empty list. The problem appeared when we tried to then populate these fonts, as CTFontDescriptorCreateMatchingFontDescriptors() would return a list of font descriptors from the PingFang SC font when called with NSFontFamilyAttribute = "Heiti SC". This is due to PingFang being a replacement for Heiti in later iOS versions. Task-number: QTBUG-50624 Change-Id: I22684e247d472c30775321b6976b3aeb6ea579f5 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* evdev: Stop reading on ENODEVLaszlo Agocs2016-06-033-7/+24
| | | | | | | | | Touch does this correctly for some time already. Keyboard and mouse do not, leading to flooding the console with the Could not read from ... warning for ever when using the 'static' device discovery (no libudev) and unplugging a mouse or keyboard. Change-Id: I6bef44fbed4bc21cc2736b28d1166bf2b7d90edc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Platformsupport: Don't include dbus on darwin.Morten Johan Sørvig2016-06-011-1/+5
| | | | | | | | | | | | | This created a false dependency from the cocoa platform plugin to QtDBus, which caused macdeployqt to deploy it. This change is for libplatformsupport only, and has no effect on QtDBus usage in general. Change-Id: I35f342574a6497ff88a785e93eef1acdea8b1452 Task-number: QTBUG-48015 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Compile Fix: unused variable in q_refreshRateFromFb() on non-linuxRalf Nolden2016-05-251-0/+4
| | | | | | | | | To fix a compile warning under non-Linux systems, declare framebufferDevice in q_refreshRateFromFb() as Q_UNUSED like in the other functions. Change-Id: I31a4e788f07d27d3cff7f6ea7fd82813a7acc7d9 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Remove linux only-dependency from devicediscoveryRalf Nolden2016-05-191-13/+9
| | | | | | | | | | As libudev and libevdev have their config.tests and do work on other operating systems as well (FreeBSD, evdev), there is no need to make this exclusive for linux only. Thus, use the checks only; the else-section can go with that at the end, too. Change-Id: I2a5175a154b4f3e001bb42d187d8c7640c014049 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cocoa: Allow pasting text from Qt apps to MailMorten Johan Sørvig2016-05-181-4/+4
| | | | | | | | | | | | | | | | | | | | | Apple Mail will pick up and attempt to use the vCard flavor, which then fails since the data Qt placed on the clipboard is not actually a valid vCard. Place data in the vCard format on the clipboard only if the mime type is “text/vcard”. [ChangeLog][OS X] Pasting text from Qt applications to Apple Mail now works. [ChangeLog][OS X] “text/vcard” is now required as the mime type when placing vCards on the clipboard. Task-number: QTBUG-48953 Change-Id: Id029b20317f2c5ad8ae225912484de3c97498d29 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* egl: Reshuffle headers to help less fortunate systems with X11Laszlo Agocs2016-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | EGL headers including X headers has traditionally been problematic due to getting macros for Status, None, etc. In most cases this is not an issue anymore because on embedded one will almost always use a driver targeting the framebuffer or DRM/KMS and therefore the EGL headers do not pull in X dependencies. Furthermore, Mesa supports MESA_EGL_NO_X11_HEADERS which we set, avoiding the problem altogether with Mesa regardless of targeting X11 or KMS. However, other drivers do not have this option. On i.MX6 for instance, targeting X11 is problematic due to not having EGL_API_FB defined, which in turn means the EGL headers pulls in X headers in order to be able to define the native display and window types as Display and Window. Try to play nice with this use case by reshuffling the includes and undefining the problematic names. This restores patch set 2 from the previously merged, and then reverted commit. This here is safe since the egl.h include and the following undefs are only done internally for eglfs and can have therefore no effect on other code. Task-number: QTBUG-52928 Change-Id: I383e783d5064dc8fb41f3ef56d2a4f4fcd31a6cf Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
* dbustray: Use separate D-Bus connections for each tray iconDmitry Shachnev2016-05-123-4/+5
| | | | | | | | | 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>
* linuxfb: Support transparencyLaszlo Agocs2016-05-092-2/+14
| | | | | | | | | | | Always clearing to opaque black makes it impossible to create semi-transparent overlays with linuxfb. Instead, behave like other platforms' backingstores: if the target image has an alpha channel, clear to transparent instead and set the correct composition mode. Task-number: QTBUG-52475 Change-Id: I2db4588e0112e200a3aa5eed49f806c37d7ca8b5 Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
* Add constants for the CoreText font weights.Jake Petroules2016-05-081-9/+52
| | | | | | | | Incidentally, this corrects two small errors in the values of the Medium and Heavy font weights. Change-Id: I17d4410890f1f3bd1ed72e94f5ca0d43c21484e1 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix crash when using QRawFont with FreeType on OS X.Jake Petroules2016-05-061-1/+1
| | | | | Change-Id: I6ca87188a46e3fe31498ed14fdce2161ecb0c966 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
* Reorder negative font weight checks in qtWeightFromCFWeight.Jake Petroules2016-05-051-4/+4
| | | | | | | | This fixes a problem that caused the QFont::Thin and QFont::ExtraLight conditions to be unreachable. Change-Id: I62a701c53222edffbddbf868311111374ae5bea8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Revert "egl: Reshuffle headers to help less fortunate systems with X11"Liang Qi2016-05-046-73/+6
| | | | | | | | | This reverts commit ecf127505effbbf4dbfd1e7cb9561de5dae51bf2. ecf12750 breaks the build of qtwayland. Change-Id: If8bf04f035aa47e4e867d201ec7d95b0d3e18317 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* egl: Reshuffle headers to help less fortunate systems with X11Laszlo Agocs2016-05-036-6/+73
| | | | | | | | | | | | | | | | | | | | | | | | EGL headers including X headers has traditionally been problematic due to getting macros for Status, None, etc. In most cases this is not an issue anymore because on embedded one will almost always use a driver targeting the framebuffer or DRM/KMS and therefore the EGL headers do not pull in X dependencies. Furthermore, Mesa supports MESA_EGL_NO_X11_HEADERS which we set, avoiding the problem altogether with Mesa regardless of targeting X11 or KMS. However, other drivers do not have this option. On i.MX6 for instance, targeting X11 is problematic due to not having EGL_API_FB defined, which in turn means the EGL headers pulls in X headers in order to be able to define the native display and window types as Display and Window. Try to play nice with this use case by reshuffling the includes and undefining the problematic names. Task-number: QTBUG-52928 Change-Id: I059f26b340b6e442e7296055915d18f5a1ce7a7f Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
* Micro optimization to QFontconfigDatabaseKonstantin Ritt2016-04-271-12/+12
| | | | | | | | Do not set WritingSystem supported just to unset it afterwards; test in-place and fallback gracefully. Change-Id: I6910019c08fcf3909b924c27271547aae2ea0ff1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Get rid of requiresOpenType() helperKonstantin Ritt2016-04-271-14/+7
| | | | | | | | | | There is already an array of writing systems for which GSUB|GPOS table is required (also rename it from "openType" to "capabilityForWritingSystem", to reflect its meaning). Change-Id: I7cfd4a80d5ca13f9312b3644b2bd738d6015c71c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Query FC_CAPABILITY once per patternKonstantin Ritt2016-04-271-2/+3
| | | | | Change-Id: I5f1219d5a476f1bd09e8c01847fe886f342b28a0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Check for required capability only when FC_CAPABILITY is availableKonstantin Ritt2016-04-271-1/+1
| | | | | | | | If, by some reason, querying FC_CAPABILITY has failed, believe FC_LANG unconditionally. Change-Id: Idf94150359dff555f2a50ccaf146722407f43477 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* dbustray: Implement better detection of indicator-applicationDmitry Shachnev2016-04-111-2/+16
| | | | | | | | | | | We need to do the icon cache trick all desktops using indicator-application, these are not limited to Unity. For example, the default Xubuntu and Lubuntu desktops use indicator-application too. Without this, tray icons will be improperly shown on these desktops. Change-Id: Id397bbe9b594152d7c3a29c36c853e928af7dde4 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* QFontEngine: Add handle() functionGabriel de Dietrich2016-03-292-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Both QFont::handle() and QFont::freetypeFace() used to be available in Qt 4 but were removed in Qt 5. There's currently no API to get access to the native font handle, which the font engine holds in a way or another. Similar to the way it was in Qt 4, the actual handle type depends on the font engine currently in use. The types map as follows: Font Engine Native Handle ------------------------------------ DirectWrite IDWriteFontFace * Freetype FT_Face Mac CTFontRef Win HFONT All other font engines return a null handle. Change-Id: I3bea8259ac1378fd24079723aa6603bf9e74834c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* Skip spurious .toLower() on returns of QUrl::scheme()Edward Welbourne2016-03-101-2/+2
| | | | | | | | | QUrl::setScheme() parses and canonicalises the scheme, so that scheme() always returns a lower-case string anyway; no need to .toLower() it. Change-Id: Ied00814b63f159386a42552dcf06346ee56f9f97 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Xft antialias settings must not override requested NoAntialiasAllan Sandfeld Jensen2016-03-101-1/+1
| | | | | | | | If Xft enabled font antialiasing, QFont::NoAntialias would have no effect as it would be overridden. Change-Id: I4dae264bc6674ae81f181cc9ce85851174d42544 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QCoreTextFontDatabase: Get rid of local fallbacksForFamily cacheKonstantin Ritt2016-03-071-7/+1
| | | | | | | | The centralized one (in QFontDatabase) does the job. Change-Id: I33def7a7bcddeaa62b904d8812321a7f4648a9d0 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* evdevtouch: ensure touchpoints released with typeB mtdev driversRomain Pokrzywka2016-03-021-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | This happens in one particular case: when the touchpoint corresponding to the last slot is reported as released and a new point is reported as pressed right after, so that both events happens within a same sync. In this case, there will be two ABS_MT_TRACKING_ID events received, first with -1 to report the released touchpoint, then with a new id to report the pressed touchpoint, then the SYN_REPORT afterwards. This results in m_contacts[m_currentSlot].state being updated to Qt::TouchPointReleased then Qt::TouchPointPressed, with the former never being reported during the handling of SYN_REPORT. To handle this scenario we need to inspect m_lastContacts for a change in tracking id for a particular slot combined with a non-null state, indicating that slot has not yet been reported released and processed in the previous sync. (the state for processed released points is reset to zero at the end of the SYN_REPORT handler) Task-number: QTBUG-51563 Change-Id: I01493008cf9f267e758d974dab29556d0a1425ea Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* 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.0' into 5.6Liang Qi2016-02-152-10/+32
|\ | | | | | | Change-Id: I0b190005377a23a91da3563428e223b8a3b18333
| * Merge 5.6 into 5.6.0Oswald Buddenhagen2016-02-022-31/+31
| |\ | | | | | | | | | Change-Id: I95962e28b6fc101cbbad41230585e2b61f1f6c0f
| * | Fix clipRect interpretation in composited backingstoresLaszlo Agocs2016-02-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Empty clipRect means "clip away completely", not "no clipping". Task-number: QTBUG-50719 Change-Id: I6a9dd66130716a921fe9fc245582274e3c9718fe Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * | eglfs: Fix up incorrect comments in the backingstoreLaszlo Agocs2016-02-011-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The note about RasterGLSurface leading to calling composeAndFlush() instead of flush() is simply not true. We have to have visible render-to-texture widgets in the window to enter the composeAndFlush() path. Change-Id: I8331b10c75a3fbefc21009c7e5bb2b4de991bf5a Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * | eglfs: Sanitize the widget compositor's context handlingLaszlo Agocs2016-01-292-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | createPlatformOpenGLContext() used to silently set the widget compositor's context as the context to share resources with. This works mostly, but is the wrong level to enforce the resource sharing. For example, QOpenGLContext::shareGroup() becomes inconsistent since from QOpenGLContext's view there was no shareContext specified. The inability to test via shareGroup() is the reason eglfs started to show warnings when exiting applications. The resource sharing was in place on EGL level but QOpenGLContext knew nothing about it. Therefore, let's switch over to the way other components, f.ex. Web Engine use: set the internal global share context pointer to the widget compositor's context. This way everything remains consistent: the widget compositor's context is stored upon creating the main QEGLFSWindow, QWidget::shareContext() picks this up then, and as a result we have sharing set up on QOpenGLContext's level instead of sneaking it in in the QPlatformOpenGLContext implementation. Task-number: QTBUG-50707 Change-Id: I5fc1dec58c69c46aa83c7b4cab1eadce6fa633ce Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * | eglfs: fix cleanup when more than one tlw was usedLaszlo Agocs2016-01-281-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is nothing guaranteeing there is a context current when the backingstore dtor is invoked for widget windows that do not contain render-to-texture widgets. In some cases the eglfs compositor's context is still current, while in other cases (esp. when having popups and other top-levels) there is none. To prevent not releasing the backingstore texture and the incorrect warning about incorrect context, make the correct context current via an offscreen surface, when necessary. Change-Id: Id8257650c1ec8cf96910a4f285b779419c3558a8 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | | dbustray: Support late registering of tray icon menuDmitry Shachnev2016-02-093-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | dbustray: Do not change m_menu in QDBusTrayIcon::createMenu()Dmitry Shachnev2016-02-091-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This method can be called for a submenu after it's called for the top-level menu, and we should not replace it with a submenu. Change-Id: I8e180ee074287cfcdc76dfe77c6c7aa7d5891741 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: 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>