From 6a9333841d9d5233b0457ec6f0da5bdacda8ea5b Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 3 Jun 2013 15:09:12 -0300 Subject: BlackBerry: fix delayed root window posting on OpenGL The delayed root window posting introduced by 77a06e7e6c517003 broke the OpenGL support. In that patch, the posting of the root window is trigerred by QQnxRasterRasterBackingStore's call to QQnxWindow::post(), that obviously does not happen when OpenGL is enabled, therefore requiring the OpenGL context to explicitly post() the root window. Change-Id: Ifd302c1dde612a03b79c778ec4586aa70f88260d Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxglcontext.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins/platforms/qnx') diff --git a/src/plugins/platforms/qnx/qqnxglcontext.cpp b/src/plugins/platforms/qnx/qqnxglcontext.cpp index 005b6d272a..ed959467ff 100644 --- a/src/plugins/platforms/qnx/qqnxglcontext.cpp +++ b/src/plugins/platforms/qnx/qqnxglcontext.cpp @@ -315,6 +315,9 @@ void QQnxGLContext::createSurface(QPlatformSurface *surface) } platformWindow->setBufferSize(surfaceSize); + // Post root window, in case it hasn't been posted yet, to make it appear. + platformWindow->screen()->onWindowPost(platformWindow); + // Obtain the native handle for our window screen_window_t handle = platformWindow->nativeHandle(); -- cgit v1.2.3 From 5f49467c526fe590435fcbadc018b753d6a0f589 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 11 Jun 2013 11:29:22 +0100 Subject: QNX: Add option to disable screen power save from an envvar Qt itself has no API for disabling screen power save, although this might make an interesting addition at some point. Instead we make the QNX QPA plugin determine if power save should be disabled from the QQNX_DISABLE_POWER_SAVE environment variable. This would typically be set in the application's bar descriptor file. Change-Id: Ie195ecd0496efd533ad9a32b65883283f471c534 Reviewed-by: Kevin Krammer Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxrootwindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/plugins/platforms/qnx') diff --git a/src/plugins/platforms/qnx/qqnxrootwindow.cpp b/src/plugins/platforms/qnx/qqnxrootwindow.cpp index 5d58890c51..ff5866d1b7 100644 --- a/src/plugins/platforms/qnx/qqnxrootwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxrootwindow.cpp @@ -162,6 +162,16 @@ QQnxRootWindow::QQnxRootWindow(const QQnxScreen *screen) if (result != 0) qFatal("QQnxRootWindow: failed to set window source position, errno=%d", errno); + // Optionally disable the screen power save + bool ok = false; + const int disablePowerSave = qgetenv("QQNX_DISABLE_POWER_SAVE").toInt(&ok); + if (ok && disablePowerSave) { + const int mode = SCREEN_IDLE_MODE_KEEP_AWAKE; + result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_IDLE_MODE, &mode); + if (result != 0) + qWarning("QQnxRootWindow: failed to disable power saving mode"); + } + createWindowGroup(); // Don't post yet. This will be lazily done from QQnxScreen upon first posting of -- cgit v1.2.3 From 0343b926608a4014ef386b3b21be9a0940d9f8e8 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 17 Jun 2013 16:46:39 -0300 Subject: QNX: Fix screen rotation The behavior introduced by qtdeclarative's 475d1ed4f6a2 mandates that an expose event follows a geometry change event. The fix for this uncovered a bug on the raster backing store which caused the rotation to break on QtWidgets. The problem was rooted on the assumption that the QQnxRasterBackingStore::flush() method was only called after paints to the backing store surface, which was discovered to be a false assumption. Flushing the backing store can occur in other circunstances, which are out of scope on the context of the QNX plugin. Task-number: QTBUG-31329 Change-Id: Icfc3e85324f5a8745f6b5f189f27f8b763f770c7 Reviewed-by: Kevin Krammer Reviewed-by: Sean Harmer --- src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp | 7 ++++++- src/plugins/platforms/qnx/qqnxwindow.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/qnx') diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp index 7204e5bce9..6a7a4d0944 100644 --- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp +++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp @@ -81,6 +81,12 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const { qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window(); + // Sometimes this method is called even though there is nothing to be + // flushed, for instance, after an expose event directly follows a + // geometry change event. + if (!m_hasUnflushedPaintOperations) + return; + QQnxWindow *targetWindow = 0; if (window) targetWindow = static_cast(window->handle()); @@ -117,7 +123,6 @@ void QQnxRasterBackingStore::flush(QWindow *window, const QRegion ®ion, const // We assume that the TLW has been flushed previously and that no changes were made to the // backing store inbetween (### does Qt guarantee this?) - Q_ASSERT(!m_hasUnflushedPaintOperations); targetWindow->adjustBufferSize(); targetWindow->blitFrom(platformWindow, offset, region); diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 4c95950a7e..87e59dac61 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -199,6 +199,7 @@ void QQnxWindow::setGeometry(const QRect &rect) // could result in re-entering QQnxWindow::setGeometry() again. QWindowSystemInterface::setSynchronousWindowsSystemEvents(true); QWindowSystemInterface::handleGeometryChange(window(), rect); + QWindowSystemInterface::handleExposeEvent(window(), rect); QWindowSystemInterface::setSynchronousWindowsSystemEvents(false); // Now move all children. -- cgit v1.2.3