Skip to content

Commit

Permalink
Switch to swoftware rendering coz hw is way too unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed May 11, 2024
1 parent 21051d9 commit 9efcacb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
24 changes: 14 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 0 additions & 1 deletion src/textutil.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "textutil.h"

#include "coloropt.h"
#include "common.h"
#include "emojiregistry.h"
#include "psiiconset.h"
#include "psioptions.h"
Expand Down
2 changes: 1 addition & 1 deletion src/webview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9efcacb

Please sign in to comment.