diff options
Diffstat (limited to 'src/plugins/platforms/openkode')
-rw-r--r-- | src/plugins/platforms/openkode/qopenkodeintegration.cpp | 10 | ||||
-rw-r--r-- | src/plugins/platforms/openkode/qopenkodeintegration.h | 6 | ||||
-rw-r--r-- | src/plugins/platforms/openkode/qopenkodewindow.cpp | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/platforms/openkode/qopenkodeintegration.cpp b/src/plugins/platforms/openkode/qopenkodeintegration.cpp index 35e744be..703b1a9 100644 --- a/src/plugins/platforms/openkode/qopenkodeintegration.cpp +++ b/src/plugins/platforms/openkode/qopenkodeintegration.cpp @@ -122,7 +122,9 @@ QOpenKODEScreen::QOpenKODEScreen(KDDisplayNV *kdDisplay, KDDesktopNV *kdDesktop } QOpenKODEIntegration::QOpenKODEIntegration() - : mEventLoopIntegration(0), mFontDb(new QGenericUnixFontDatabase()) + : mEventLoopIntegration(0) + , mFontDb(new QGenericUnixFontDatabase()) + , mMainGlContext(0) { if (kdInitializeNV() == KD_ENOTINITIALIZED) { qFatal("Did not manage to initialize openkode"); @@ -190,6 +192,7 @@ bool QOpenKODEIntegration::hasCapability(QPlatformIntegration::Capability cap) c { switch (cap) { case ThreadedPixmaps: return true; + case OpenGL: return true; default: return QPlatformIntegration::hasCapability(cap); } } @@ -226,11 +229,6 @@ QWindowSurface *QOpenKODEIntegration::createWindowSurface(QWidget *widget, WId) return returnSurface; } -bool QOpenKODEIntegration::hasOpenGL() const -{ - return true; -} - QPlatformEventLoopIntegration *QOpenKODEIntegration::createEventLoopIntegration() const { if (!mEventLoopIntegration) { diff --git a/src/plugins/platforms/openkode/qopenkodeintegration.h b/src/plugins/platforms/openkode/qopenkodeintegration.h index 7582e60..d5aac98 100644 --- a/src/plugins/platforms/openkode/qopenkodeintegration.h +++ b/src/plugins/platforms/openkode/qopenkodeintegration.h @@ -96,8 +96,6 @@ public: QPlatformWindow *createPlatformWindow(QWidget *widget, WId winId = 0) const; QWindowSurface *createWindowSurface(QWidget *widget, WId winId) const; - bool hasOpenGL() const; - QPlatformEventLoopIntegration *createEventLoopIntegration() const; QPlatformFontDatabase *fontDatabase() const; @@ -106,10 +104,14 @@ public: static GLuint blitterProgram(); + void setMainGLContext(QEGLPlatformContext *ctx) { mMainGlContext = ctx; } + void mainGLContext() const { return mMainGlContext; } + private: QList<QPlatformScreen *> mScreens; QOpenKODEEventLoopIntegration *mEventLoopIntegration; QPlatformFontDatabase *mFontDb; + QEGLPlatformContext *mMainGlContext; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/openkode/qopenkodewindow.cpp b/src/plugins/platforms/openkode/qopenkodewindow.cpp index 66530a5..d34dff8 100644 --- a/src/plugins/platforms/openkode/qopenkodewindow.cpp +++ b/src/plugins/platforms/openkode/qopenkodewindow.cpp @@ -147,9 +147,9 @@ QOpenKODEWindow::QOpenKODEWindow(QWidget *tlw) } + QOpenKODEIntegration *integration = static_cast<QOpenKODEIntegration *>(QApplicationPrivate::platformIntegration()); - - if (!isFullScreen || (isFullScreen && !QPlatformGLContext::defaultSharedContext())) { + if (!isFullScreen || (isFullScreen && !integration->mainGLContext())) { if (kdRealizeWindow(m_kdWindow, &m_eglWindow)) { qErrnoWarning(kdGetError(), "Could not realize native window"); return; @@ -158,9 +158,9 @@ QOpenKODEWindow::QOpenKODEWindow(QWidget *tlw) EGLSurface surface = eglCreateWindowSurface(screen->eglDisplay(),m_eglConfig,m_eglWindow,m_eglWindowAttrs.constData()); m_platformGlContext = new QEGLPlatformContext(screen->eglDisplay(), m_eglConfig, m_eglContextAttrs.data(), surface, m_eglApi); - m_platformGlContext->makeDefaultSharedContext(); + integration->setMainGLContext(m_platformGLContext); } else { - m_platformGlContext = const_cast<QEGLPlatformContext *>(static_cast<const QEGLPlatformContext *>(QPlatformGLContext::defaultSharedContext())); + m_platformGlContext = integration->mainGLContext(); kdDestroyWindow(m_kdWindow); m_kdWindow = 0; } @@ -169,7 +169,7 @@ QOpenKODEWindow::QOpenKODEWindow(QWidget *tlw) QOpenKODEWindow::~QOpenKODEWindow() { - if (m_platformGlContext != QPlatformGLContext::defaultSharedContext()) { + if (m_platformGlContext != static_cast<QOpenKODEIntegration *>(QApplicationPrivate::platformIntegration())) { delete m_platformGlContext; } if (m_kdWindow) |