summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx/qqnxscreen.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-13 11:58:07 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-14 14:24:57 +0100
commite65cd6f3794e12e6bc5c2ee985eae8e70ff5f333 (patch)
tree8965835c375422d63b2ccfa927b31a56e64bda1d /src/plugins/platforms/qnx/qqnxscreen.cpp
parentd1ee7189553e13337b198fe4ba66d79fb7a7f41d (diff)
parente95a758236cf2c68e33da4ddb62bff4fe8d9dd8b (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxscreen.cpp')
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 5450f086e9..fc8b3bb167 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -107,7 +107,6 @@ static QSize determineScreenSize(screen_display_t display, bool primaryScreen) {
QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, bool primaryScreen)
: m_screenContext(screenContext),
m_display(display),
- m_rootWindow(),
m_primaryScreen(primaryScreen),
m_posted(false),
m_keyboardHeight(0),
@@ -147,10 +146,6 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display,
m_currentPhysicalSize = m_initialPhysicalSize = screenSize;
else
m_currentPhysicalSize = m_initialPhysicalSize = screenSize.transposed();
-
- // We only create the root window if we are the primary display.
- if (primaryScreen)
- m_rootWindow = QSharedPointer<QQnxRootWindow>(new QQnxRootWindow(this));
}
QQnxScreen::~QQnxScreen()
@@ -252,8 +247,8 @@ void QQnxScreen::setRotation(int rotation)
// Check if rotation changed
if (m_currentRotation != rotation) {
// Update rotation of root window
- if (m_rootWindow)
- m_rootWindow->setRotation(rotation);
+ if (rootWindow())
+ rootWindow()->setRotation(rotation);
const QRect previousScreenGeometry = geometry();
@@ -269,16 +264,16 @@ void QQnxScreen::setRotation(int rotation)
// Resize root window if we've rotated 90 or 270 from previous orientation
if (isOrthogonal(m_currentRotation, rotation)) {
qScreenDebug() << Q_FUNC_INFO << "resize, size =" << m_currentGeometry.size();
- if (m_rootWindow)
- m_rootWindow->resize(m_currentGeometry.size());
+ if (rootWindow())
+ rootWindow()->resize(m_currentGeometry.size());
if (m_primaryScreen)
resizeWindows(previousScreenGeometry);
} else {
// TODO: Find one global place to flush display updates
// Force immediate display update if no geometry changes required
- if (m_rootWindow)
- m_rootWindow->flush();
+ if (rootWindow())
+ rootWindow()->flush();
}
// Save new rotation
@@ -495,8 +490,8 @@ void QQnxScreen::onWindowPost(QQnxWindow *window)
// post app window (so navigator will show it) after first child window
// has posted; this only needs to happen once as the app window's content
// never changes
- if (!m_posted && m_rootWindow) {
- m_rootWindow->post();
+ if (!m_posted && rootWindow()) {
+ rootWindow()->post();
m_posted = true;
}
}
@@ -582,4 +577,13 @@ void QQnxScreen::deactivateWindowGroup(const QByteArray &id)
QWindowSystemInterface::handleWindowActivated(0);
}
+QSharedPointer<QQnxRootWindow> QQnxScreen::rootWindow() const
+{
+ // We only create the root window if we are the primary display.
+ if (m_primaryScreen && !m_rootWindow)
+ m_rootWindow = QSharedPointer<QQnxRootWindow>(new QQnxRootWindow(this));
+
+ return m_rootWindow;
+}
+
QT_END_NAMESPACE