summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r--src/plugins/platforms/qnx/qqnxrootwindow.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxrootwindow.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.cpp30
-rw-r--r--src/plugins/platforms/qnx/qqnxscreen.h8
4 files changed, 24 insertions, 20 deletions
diff --git a/src/plugins/platforms/qnx/qqnxrootwindow.cpp b/src/plugins/platforms/qnx/qqnxrootwindow.cpp
index ee05e00394..b01d468647 100644
--- a/src/plugins/platforms/qnx/qqnxrootwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxrootwindow.cpp
@@ -57,7 +57,7 @@
static const int MAGIC_ZORDER_FOR_NO_NAV = 10;
-QQnxRootWindow::QQnxRootWindow(QQnxScreen *screen)
+QQnxRootWindow::QQnxRootWindow(const QQnxScreen *screen)
: m_screen(screen),
m_window(0),
m_windowGroupName()
diff --git a/src/plugins/platforms/qnx/qqnxrootwindow.h b/src/plugins/platforms/qnx/qqnxrootwindow.h
index f9f1dc0810..aae1563c95 100644
--- a/src/plugins/platforms/qnx/qqnxrootwindow.h
+++ b/src/plugins/platforms/qnx/qqnxrootwindow.h
@@ -54,7 +54,7 @@ class QQnxScreen;
class QQnxRootWindow
{
public:
- QQnxRootWindow(QQnxScreen *screen);
+ QQnxRootWindow(const QQnxScreen *screen);
~QQnxRootWindow();
screen_window_t nativeHandle() const { return m_window; }
@@ -71,7 +71,7 @@ public:
private:
void createWindowGroup();
- QQnxScreen *m_screen;
+ const QQnxScreen *m_screen;
screen_window_t m_window;
QByteArray m_windowGroupName;
};
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp
index 8b413de4fb..1e58f047ab 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.cpp
+++ b/src/plugins/platforms/qnx/qqnxscreen.cpp
@@ -106,7 +106,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),
@@ -145,10 +144,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()
@@ -248,8 +243,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();
@@ -265,16 +260,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
@@ -491,8 +486,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;
}
}
@@ -573,4 +568,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
diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h
index be09eca1f8..2851c13c52 100644
--- a/src/plugins/platforms/qnx/qqnxscreen.h
+++ b/src/plugins/platforms/qnx/qqnxscreen.h
@@ -80,7 +80,7 @@ public:
int nativeFormat() const { return (depth() == 32) ? SCREEN_FORMAT_RGBA8888 : SCREEN_FORMAT_RGB565; }
screen_display_t nativeDisplay() const { return m_display; }
screen_context_t nativeContext() const { return m_screenContext; }
- const char *windowGroupName() const { return m_rootWindow->groupName().constData(); }
+ const char *windowGroupName() const { return rootWindow()->groupName().constData(); }
QQnxWindow *findWindow(screen_window_t windowHandle);
@@ -93,7 +93,7 @@ public:
void onWindowPost(QQnxWindow *window);
- QSharedPointer<QQnxRootWindow> rootWindow() const { return m_rootWindow; }
+ QSharedPointer<QQnxRootWindow> rootWindow() const;
public Q_SLOTS:
void setRotation(int rotation);
@@ -114,8 +114,8 @@ private:
screen_context_t m_screenContext;
screen_display_t m_display;
- QSharedPointer<QQnxRootWindow> m_rootWindow;
- bool m_primaryScreen;
+ mutable QSharedPointer<QQnxRootWindow> m_rootWindow;
+ const bool m_primaryScreen;
bool m_posted;
int m_initialRotation;