Made eglfs work with backing store based applications again.
authorSamuel Rødal <samuel.rodal@nokia.com>
Wed, 15 Aug 2012 10:18:35 +0000 (12:18 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 15 Aug 2012 19:13:18 +0000 (21:13 +0200)
Make sure we pick the same config for the context and window surface,
and do not create unnecessary window surfaces for the desktop widget.

Change-Id: I3c8fb3df9ab8a658196e41dfa1705cfca625a2d7
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
src/plugins/platforms/eglfs/qeglfsscreen.h
src/plugins/platforms/eglfs/qeglfswindow.cpp

index edcf116..2caf106 100644 (file)
@@ -57,7 +57,7 @@ QEglFSBackingStore::QEglFSBackingStore(QWindow *window)
     , m_texture(0)
     , m_program(0)
 {
-    m_context->setFormat(window->format());
+    m_context->setFormat(window->requestedFormat());
     m_context->setScreen(window->screen());
     m_context->create();
 }
index 518a5c6..7632921 100644 (file)
@@ -65,8 +65,6 @@ public:
 
     QPlatformCursor *cursor() const;
 
-    QPlatformOpenGLContext *platformContext() const;
-
     EGLDisplay display() const { return m_dpy; }
 
 private:
index b07fd19..913e1c2 100644 (file)
@@ -72,7 +72,15 @@ QEglFSWindow::~QEglFSWindow()
 
 void QEglFSWindow::create()
 {
-    Q_ASSERT(!m_window);
+    if (m_window)
+        return;
+
+    if (window()->windowType() == Qt::Desktop) {
+        QRect rect(QPoint(), hooks->screenSize());
+        QPlatformWindow::setGeometry(rect);
+        QWindowSystemInterface::handleGeometryChange(window(), rect);
+        return;
+    }
 
     EGLDisplay display = (static_cast<QEglFSScreen *>(window()->screen()->handle()))->display();
     QSurfaceFormat platformFormat = hooks->surfaceFormatFor(window()->requestedFormat());