From 9efcacbb8222d55336c0423538ac2f15ad1fd85f Mon Sep 17 00:00:00 2001 From: Sergei Ilinykh Date: Sat, 11 May 2024 13:08:29 +0300 Subject: [PATCH] Switch to swoftware rendering coz hw is way too unstable --- src/main.cpp | 24 ++++++++++++++---------- src/textutil.cpp | 1 - src/webview.cpp | 2 +- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ed5c90fb9..25dc5b444 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -509,17 +509,21 @@ PSI_EXPORT_FUNC int main(int argc, char *argv[]) #endif #if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) && QT_VERSION <= QT_VERSION_CHECK(6, 8, 0) && defined(WEBENGINE) - // let's hope https://bugreports.qt.io/browse/QTBUG-119221 is going to be fixed before 6.8.0 - // Qt::WA_NativeWindow is already added to webview.cpp - qputenv("QT_WIDGETS_RHI", "1"); -#ifdef Q_OS_WIN - qputenv("QT_WIDGETS_RHI_BACKEND", "d3d11"); -#elif defined(Q_OS_MAC) - qputenv("QT_WIDGETS_RHI_BACKEND", "metal"); -#else - qputenv("QT_WIDGETS_RHI_BACKEND", "opengl"); -#endif +// let's hope https://bugreports.qt.io/browse/QTBUG-119221 is going to be fixed before 6.8.0 +// Qt::WA_NativeWindow is already added to WebView::WebView. +// Note, it can be highly unstable on some systems. If you enable this, then also remove AA_UseSoftwareOpenGL +// below. +// +// qputenv("QT_WIDGETS_RHI", "1"); +// #ifdef Q_OS_WIN +// qputenv("QT_WIDGETS_RHI_BACKEND", "d3d11"); +// #elif defined(Q_OS_MAC) +// qputenv("QT_WIDGETS_RHI_BACKEND", "metal"); +// #else +// qputenv("QT_WIDGETS_RHI_BACKEND", "opengl"); +// #endif #endif + QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); PsiApplication app(argc, argv); QApplication::setApplicationName(ApplicationInfo::name()); diff --git a/src/textutil.cpp b/src/textutil.cpp index fea935147..81209a1f1 100644 --- a/src/textutil.cpp +++ b/src/textutil.cpp @@ -1,7 +1,6 @@ #include "textutil.h" #include "coloropt.h" -#include "common.h" #include "emojiregistry.h" #include "psiiconset.h" #include "psioptions.h" diff --git a/src/webview.cpp b/src/webview.cpp index a71e16268..172a6824d 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -53,7 +53,7 @@ WebView::WebView(QWidget *parent) : setAcceptDrops(false); #ifdef WEBENGINE - setAttribute(Qt::WA_NativeWindow); + // setAttribute(Qt::WA_NativeWindow); // see https://bugreports.qt.io/browse/QTBUG-119221 (potentially unstable) settings()->setAttribute(QWebEngineSettings::PluginsEnabled, false); settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, false); // TODO cache cotrol