diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2012-11-19 13:37:45 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-19 17:12:58 +0100 |
commit | 433e7cef1e05181e717419d0eda3af777106dadf (patch) | |
tree | a3b649c3fdb297537b16ef2f859fa14a74bea5aa /src/plugins/platforms/xcb/qxcbnativeinterface.cpp | |
parent | e8c677a9305f9485d65135eb59ca5b63c2106287 (diff) |
QSystemTrayIcon/X11: Use display obtained as native screen resource.
Previously, the screen name was used, which contained the
display name. This was changed to return the xrandr-name.
Task-number: QTBUG-5416
Change-Id: I560143d6d459a8051c9640079cf7d39a3caebfec
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index fa5f5f43d0..a44e7fb959 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -104,6 +104,25 @@ void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceSt return result; } +void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resource, QScreen *screen) +{ + const QXcbResourceMap::const_iterator it = qXcbResourceMap()->constFind(resource.toLower()); + if (it == qXcbResourceMap()->constEnd() || !screen->handle()) + return 0; + const QXcbScreen *xcbScreen = static_cast<QXcbScreen *>(screen->handle()); + switch (it.value()) { + case Display: +#ifdef XCB_USE_XLIB + return xcbScreen->connection()->xlib_display(); +#else + break; +#endif + default: + break; + } + return 0; +} + void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) { QByteArray lowerCaseResource = resourceString.toLower(); |