[Libreoffice-commits] core.git: vcl/inc vcl/qt5

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 20 07:56:37 UTC 2021


 vcl/inc/qt5/Qt5Instance.hxx |    3 +++
 vcl/qt5/Qt5Instance.cxx     |    8 +++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 0f7fed9249e988ca34c5401d746887822b4aa9ce
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Aug 19 20:18:47 2021 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Aug 20 09:56:01 2021 +0200

    tdf#143957 Qt5 always create an OpenGLContext
    
    Nothing checks the result and a lot of code just uses it.
    
    Change-Id: I1a672e98d42673fd684538ead831622f6a14e9f0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120761
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx
index 41b9aca894d0..dc347021b9bb 100644
--- a/vcl/inc/qt5/Qt5Instance.hxx
+++ b/vcl/inc/qt5/Qt5Instance.hxx
@@ -133,7 +133,10 @@ public:
     virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override;
     virtual bool AnyInput(VclInputFlags nType) override;
 
+// so we fall back to the default abort, instead of duplicating it...
+#ifndef EMSCRIPTEN
     virtual OpenGLContext* CreateOpenGLContext() override;
+#endif
 
     virtual OUString GetConnectionIdentifier() override;
 
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index bf8d52961960..432af5e6f718 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -245,6 +245,10 @@ Qt5Instance::Qt5Instance(std::unique_ptr<QApplication>& pQApp, bool bUseCairo)
 
     connect(QGuiApplication::inputMethod(), &QInputMethod::localeChanged, this,
             &Qt5Instance::localeChanged);
+
+#ifdef EMSCRIPTEN
+    m_bSupportsOpenGL = false;
+#endif
 }
 
 Qt5Instance::~Qt5Instance()
@@ -432,7 +436,9 @@ OUString Qt5Instance::GetConnectionIdentifier() { return OUString(); }
 
 void Qt5Instance::AddToRecentDocumentList(const OUString&, const OUString&, const OUString&) {}
 
-OpenGLContext* Qt5Instance::CreateOpenGLContext() { return nullptr; }
+#ifndef EMSCRIPTEN
+OpenGLContext* Qt5Instance::CreateOpenGLContext() { return new Qt5OpenGLContext; }
+#endif
 
 bool Qt5Instance::IsMainThread() const
 {


More information about the Libreoffice-commits mailing list