[education/rkward] rkward: Disable chromium GPU acceleration by default (configurable)
Thomas Friedrichsmeier
null at kde.org
Fri Mar 13 17:10:48 GMT 2026
Git commit d0db40170b0e379c6a79e5f5f727f9324e64b002 by Thomas Friedrichsmeier.
Committed on 13/03/2026 at 17:10.
Pushed by tfry into branch 'master'.
Disable chromium GPU acceleration by default (configurable)
It is causing much trouble than it is worth.
M +5 -0 rkward/rkward.cpp
M +4 -0 rkward/settings/rksettingsmodulegeneral.cpp
M +2 -0 rkward/settings/rksettingsmodulegeneral.h
https://invent.kde.org/education/rkward/-/commit/d0db40170b0e379c6a79e5f5f727f9324e64b002
diff --git a/rkward/rkward.cpp b/rkward/rkward.cpp
index 9b64264cf..f9cdcdb18 100644
--- a/rkward/rkward.cpp
+++ b/rkward/rkward.cpp
@@ -147,6 +147,11 @@ RKWardMainWindow::RKWardMainWindow() : KParts::MainWindow() {
connect(partManager(), &KParts::PartManager::activePartChanged, this, &RKWardMainWindow::partChanged);
readOptions();
+ if (RKSettingsModuleGeneral::disableHardwareRendering()) {
+ auto chromiumflags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS");
+ chromiumflags = "--disable-gpu " + chromiumflags;
+ qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromiumflags);
+ }
new RKModificationTracker(this);
initToolViewsAndR();
diff --git a/rkward/settings/rksettingsmodulegeneral.cpp b/rkward/settings/rksettingsmodulegeneral.cpp
index 2ebdf6211..a0f9cf07e 100644
--- a/rkward/settings/rksettingsmodulegeneral.cpp
+++ b/rkward/settings/rksettingsmodulegeneral.cpp
@@ -50,6 +50,7 @@ bool RKSettingsModuleGeneral::rkward_version_changed;
bool RKSettingsModuleGeneral::installation_moved = false;
QString RKSettingsModuleGeneral::previous_rkward_data_dir;
RKConfigValue<int> RKSettingsModuleGeneral::num_recent_files{"Max number of recent files", 8};
+RKConfigValue<bool> RKSettingsModuleGeneral::disable_hardware_rendering{"disable_hardware_rendering", true};
class RKSettingsPageGeneral : public RKSettingsModuleWidget {
public:
@@ -70,6 +71,9 @@ class RKSettingsPageGeneral : public RKSettingsModuleWidget {
auto vbox = new QVBoxLayout(group);
vbox->addWidget(RKSettingsModuleGeneral::autorestore_from_wd.makeCheckbox(i18n("Load .RData-file from startup directory, if available (R option '--restore')"), this));
vbox->addWidget(RKSettingsModuleGeneral::show_help_on_startup.makeCheckbox(i18n("Show RKWard Help on Startup"), this));
+ auto cb = RKSettingsModuleGeneral::disable_hardware_rendering.makeCheckbox(i18n("Disable HTML hardware rendering (setting takes effect after restarting RKWard)"), this);
+ RKCommonFunctions::setTips(i18n("The use of hardware accelaration for HTML rendering (e.g. help pages and plugin output) is known to cause instability in some installations, and is not generally needed for the - usually simple - content shown in RKWard. It is recommended to leave hardware accelaration disabled, unless you experience performance problems while viewing HTML content inside RKWard."), cb);
+ vbox->addWidget(cb);
QGroupBox *group_box = new QGroupBox(i18n("Initial working directory"), this);
QHBoxLayout *hlayout = new QHBoxLayout(group_box);
diff --git a/rkward/settings/rksettingsmodulegeneral.h b/rkward/settings/rksettingsmodulegeneral.h
index 4840b47eb..d82ba54c6 100644
--- a/rkward/settings/rksettingsmodulegeneral.h
+++ b/rkward/settings/rksettingsmodulegeneral.h
@@ -49,6 +49,7 @@ class RKSettingsModuleGeneral : public RKSettingsModule {
/// returns the directory-name where the logfiles should reside
static QString &filesPath() { return files_path; };
static bool showHelpOnStartup() { return show_help_on_startup; };
+ static bool disableHardwareRendering() { return disable_hardware_rendering; };
static bool openRestoreFileOnLoad() { return autorestore_from_wd; };
static WorkplaceSaveMode workplaceSaveMode() { return workplace_save_mode; };
/** retrieve the saved workplace description. Meaningful only is workplaceSaveMode () == SaveWorkplaceWithSession */
@@ -107,6 +108,7 @@ class RKSettingsModuleGeneral : public RKSettingsModule {
static bool rkward_version_changed;
static bool installation_moved;
static RKConfigValue<int> num_recent_files;
+ static RKConfigValue<bool> disable_hardware_rendering;
};
#endif
More information about the rkward-tracker
mailing list