summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Weimer <bweimer@blackberry.com>2014-01-28 11:01:38 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-29 00:18:15 +0100
commitb709d07c340e2a6cc3d004f3edf1232b7104b38b (patch)
tree6589dc65bc111a7b22d932efad8294497ea9161e
parent6ab6ab73fe1055de8ce5a3b353b037424a84e187 (diff)
QNX: Cleanup some issues in QPA
* Avoided crash, if root window is reparented * Corrected video window name * Made parent window member private again Change-Id: Icef9fad5495413e0de87c4366f25dad6c4fd5775 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterwindow.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp7
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h3
4 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
index 795b122319..fc86525c3c 100644
--- a/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterwindow.cpp
@@ -166,7 +166,7 @@ void QQnxRasterWindow::adjustBufferSize()
{
// When having a raster window we don't need any buffers, since
// Qt will draw to the parent TLW backing store.
- const QSize windowSize = m_parentWindow ? QSize(1,1) : window()->size();
+ const QSize windowSize = window()->parent() ? QSize(1,1) : window()->size();
if (windowSize != bufferSize())
setBufferSize(windowSize);
}
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 8d35362b34..1bffeca154 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -670,7 +670,7 @@ void QQnxScreen::newWindowCreated(void *window)
// Otherwise, assume that if a foreign window already has a Z-Order both negative and
// less than the default Z-Order installed by mmrender on windows it creates,
// the windows should be treated as an underlay. Otherwise, we treat it as an overlay.
- if (!windowName.isEmpty() && windowName.startsWith("BbVideoWindowControl")) {
+ if (!windowName.isEmpty() && windowName.startsWith("MmRendererVideoWindowControl")) {
addMultimediaWindow(windowName, windowHandle);
} else if (!findWindow(windowHandle)) {
if (zorder <= MAX_UNDERLAY_ZORDER)
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 321a5ed6da..fe66d547f3 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -75,9 +75,9 @@ QT_BEGIN_NAMESPACE
QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context, bool needRootWindow)
: QPlatformWindow(window),
m_screenContext(context),
- m_parentWindow(0),
m_window(0),
m_screen(0),
+ m_parentWindow(0),
m_visible(false),
m_exposed(true),
m_windowState(Qt::WindowNoState),
@@ -380,6 +380,11 @@ void QQnxWindow::setParent(const QPlatformWindow *window)
if (newParent == m_parentWindow)
return;
+ if (screen()->rootWindow() == this) {
+ qWarning() << "Application window cannot be reparented";
+ return;
+ }
+
removeFromParent();
m_parentWindow = newParent;
diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h
index 5fa7b32dc8..750ce763d2 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.h
+++ b/src/plugins/platforms/qnx/qqnxwindow.h
@@ -122,8 +122,6 @@ protected:
screen_context_t m_screenContext;
QScopedPointer<QQnxAbstractCover> m_cover;
- QQnxWindow *m_parentWindow;
-
private:
void createWindowGroup();
void setGeometryHelper(const QRect &rect);
@@ -137,6 +135,7 @@ private:
QSize m_bufferSize;
QQnxScreen *m_screen;
+ QQnxWindow *m_parentWindow;
QList<QQnxWindow*> m_childWindows;
bool m_visible;
bool m_exposed;