From 94c17dce04c7726afbdd6ac67c569eedc629a81a Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Fri, 22 Nov 2013 10:43:49 +0100 Subject: 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 --- src/plugins/platforms/qnx/qqnxnativeinterface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/plugins') 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(window->screen()->handle()); + QQnxScreen * const screen = static_cast(window->screen()->handle()); if (screen) { + screen_window_t screenWindow = reinterpret_cast(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(screen->rootWindow()->groupName().constData()); + return qnxWindow ? const_cast(qnxWindow->groupName().constData()) : 0; } } -- cgit v1.2.3