forked from Silverfish/proton-bridge
GODT-1438: Turn off SW OpenGL on windows and add debug info about graphic renderer.
This commit is contained in:
@ -23,6 +23,7 @@ package qt
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
qmlLog "github.com/ProtonMail/proton-bridge/internal/frontend/qt/log"
|
qmlLog "github.com/ProtonMail/proton-bridge/internal/frontend/qt/log"
|
||||||
"github.com/therecipe/qt/core"
|
"github.com/therecipe/qt/core"
|
||||||
@ -36,13 +37,22 @@ func (f *FrontendQt) initiateQtApplication() error {
|
|||||||
|
|
||||||
f.app = widgets.NewQApplication(len(os.Args), os.Args)
|
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_SetApplicationName(f.programName)
|
||||||
core.QCoreApplication_SetApplicationVersion(f.programVersion)
|
core.QCoreApplication_SetApplicationVersion(f.programVersion)
|
||||||
|
|
||||||
// High DPI scaling for windows.
|
// High DPI scaling for windows.
|
||||||
core.QCoreApplication_SetAttribute(core.Qt__AA_EnableHighDpiScaling, false)
|
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.
|
// Bridge runs background, no window is needed to be opened.
|
||||||
f.app.SetQuitOnLastWindowClosed(false)
|
f.app.SetQuitOnLastWindowClosed(false)
|
||||||
|
|||||||
Reference in New Issue
Block a user