From 069469b468c482244c5d0c1459be32e8fbbca1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 15 Aug 2012 12:18:35 +0200 Subject: Made eglfs work with backing store based applications again. 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 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/eglfs/qeglfsbackingstore.cpp | 2 +- src/plugins/platforms/eglfs/qeglfsscreen.h | 2 -- src/plugins/platforms/eglfs/qeglfswindow.cpp | 10 +++++++++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp index edcf116b04..2caf1064cf 100644 --- a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp +++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp @@ -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(); } diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h index 518a5c6478..7632921145 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.h +++ b/src/plugins/platforms/eglfs/qeglfsscreen.h @@ -65,8 +65,6 @@ public: QPlatformCursor *cursor() const; - QPlatformOpenGLContext *platformContext() const; - EGLDisplay display() const { return m_dpy; } private: diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp index b07fd19d1d..913e1c2e1e 100644 --- a/src/plugins/platforms/eglfs/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp @@ -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(window()->screen()->handle()))->display(); QSurfaceFormat platformFormat = hooks->surfaceFormatFor(window()->requestedFormat()); -- cgit v1.2.3