From 7276c23b2bba7ce201d3bd4b947c4bc210c0e773 Mon Sep 17 00:00:00 2001 From: Jakub Date: Wed, 8 Dec 2021 09:37:43 +0100 Subject: [PATCH] GODT-1438: Turn off SW OpenGL on windows and add debug info about graphic renderer. --- internal/frontend/qt/frontend_init.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/frontend/qt/frontend_init.go b/internal/frontend/qt/frontend_init.go index 5c8599c2..29d01fa6 100644 --- a/internal/frontend/qt/frontend_init.go +++ b/internal/frontend/qt/frontend_init.go @@ -23,6 +23,7 @@ package qt import ( "errors" "os" + "runtime" qmlLog "github.com/ProtonMail/proton-bridge/internal/frontend/qt/log" "github.com/therecipe/qt/core" @@ -36,13 +37,22 @@ func (f *FrontendQt) initiateQtApplication() error { f.app = widgets.NewQApplication(len(os.Args), os.Args) + if os.Getenv("QSG_INFO") != "" && os.Getenv("QSG_INFO") != "0" { + core.QLoggingCategory_SetFilterRules("qt.scenegraph.general=true") + } + core.QCoreApplication_SetApplicationName(f.programName) core.QCoreApplication_SetApplicationVersion(f.programVersion) // High DPI scaling for windows. core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, false) - // Software OpenGL: to avoid dedicated GPU. - core.QCoreApplication_SetAttribute(core.Qt__AA_UseSoftwareOpenGL, true) + + // Use software OpenGL to avoid dedicated GPU on darwin. It cause no + // problems on linux, but it can cause initializaion issues on windows + // for some specific GPU / driver combination. + if runtime.GOOS != "windows" { + core.QCoreApplication_SetAttribute(core.Qt__AA_UseSoftwareOpenGL, true) + } // Bridge runs background, no window is needed to be opened. f.app.SetQuitOnLastWindowClosed(false)