From ff7f3aba39e69465caeea2f6fff0f41ec86fdb44 Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Wed, 12 Mar 2014 11:44:21 -0400 Subject: Complete support for no-fullscreen parameter Change the code so that it doesn't force application windows to full screen when the no-fullscreen parameter is used in the QT_QPA_PLATFORM environment variable. Task-number: QTBUG-37456 Change-Id: If9612cc2ca69f829d45e7fd4b83338c3a41cf986 Reviewed-by: Kevin Krammer Reviewed-by: Fabian Bumberger --- src/plugins/platforms/qnx/qqnxeglwindow.cpp | 5 ++--- src/plugins/platforms/qnx/qqnxwindow.cpp | 9 +++++++-- src/plugins/platforms/qnx/qqnxwindow.h | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/qnx') diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp index 3c08cc9f82..f1f9f5469c 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp @@ -70,8 +70,7 @@ QQnxEglWindow::QQnxEglWindow(QWindow *window, screen_context_t context, bool nee if (result != 0) qFatal("QQnxEglWindow: failed to set window alpha usage, errno=%d", errno); - m_requestedBufferSize = screen()->rootWindow() == this ? - screen()->geometry().size() : window->geometry().size(); + m_requestedBufferSize = shouldMakeFullScreen() ? screen()->geometry().size() : window->geometry().size(); } QQnxEglWindow::~QQnxEglWindow() @@ -156,7 +155,7 @@ EGLSurface QQnxEglWindow::getSurface() void QQnxEglWindow::setGeometry(const QRect &rect) { //If this is the root window, it has to be shown fullscreen - const QRect &newGeometry = screen()->rootWindow() == this ? screen()->geometry() : rect; + const QRect &newGeometry = shouldMakeFullScreen() ? screen()->geometry() : rect; //We need to request that the GL context updates // the EGLsurface on which it is rendering. diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 9ae2d01ab4..e43aaa83e8 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -242,7 +242,7 @@ QQnxWindow::~QQnxWindow() void QQnxWindow::setGeometry(const QRect &rect) { QRect newGeometry = rect; - if (screen()->rootWindow() == this) //If this is the root window, it has to be shown fullscreen + if (shouldMakeFullScreen()) newGeometry = screen()->geometry(); setGeometryHelper(newGeometry); @@ -714,7 +714,7 @@ void QQnxWindow::initWindow() if (window()->parent() && window()->parent()->handle()) setParent(window()->parent()->handle()); - if (screen()->rootWindow() == this) { + if (shouldMakeFullScreen()) { setGeometryHelper(screen()->geometry()); QWindowSystemInterface::handleGeometryChange(window(), screen()->geometry()); } else { @@ -817,4 +817,9 @@ void QQnxWindow::windowPosted() qqnxLgmonFramePosted(m_cover); // for performance measurements } +bool QQnxWindow::shouldMakeFullScreen() const +{ + return ((screen()->rootWindow() == this) && (QQnxIntegration::options() & QQnxIntegration::FullScreenApplication)); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h index e97e941a08..9a2006396f 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.h +++ b/src/plugins/platforms/qnx/qqnxwindow.h @@ -112,6 +112,8 @@ public: QByteArray groupName() const { return m_windowGroupName; } void joinWindowGroup(const QByteArray &groupName); + bool shouldMakeFullScreen() const; + protected: virtual int pixelFormat() const = 0; virtual void resetBuffers() = 0; -- cgit v1.2.3