summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFrank Osterfeld <frank.osterfeld.qnx@kdab.com>2013-11-22 10:43:49 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-27 08:25:15 +0100
commit94c17dce04c7726afbdd6ac67c569eedc629a81a (patch)
tree6bf985697e5a18ce4cbbb8179a333c2977af428f /src/plugins
parentf03fd0d82a50361c0b89165b3f8d98d66b0a4e16 (diff)
QNX: Fix retrieving the window group name
The code assumes that there is a root window, and crashed otherwise. Task-number: QTBUG-35121 Change-Id: Idbf0e0bfc03cd427f0aab81db88b34fe94228c81 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/qnx/qqnxnativeinterface.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp
index 8958a5c1e2..24af5c2683 100644
--- a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp
+++ b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp
@@ -52,11 +52,13 @@ QT_BEGIN_NAMESPACE
void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
{
if (resource == "windowGroup" && window && window->screen()) {
- const QQnxScreen * const screen = static_cast<QQnxScreen *>(window->screen()->handle());
+ QQnxScreen * const screen = static_cast<QQnxScreen *>(window->screen()->handle());
if (screen) {
+ screen_window_t screenWindow = reinterpret_cast<screen_window_t>(window->winId());
+ QQnxWindow *qnxWindow = screen->findWindow(screenWindow);
// We can't just call data() instead of constData() here, since that would detach
// and the lifetime of the char * would not be long enough. Therefore the const_cast.
- return const_cast<char *>(screen->rootWindow()->groupName().constData());
+ return qnxWindow ? const_cast<char *>(qnxWindow->groupName().constData()) : 0;
}
}