Commit 955948e2 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Use software rendering if we cannot use OpenGL and complain about it

Use KQuickAddons::QtQuickSettings to fallback to software rendering if
OpenGL context creation fails. When using software rendering, we display
a message at the top of the window that complains about it.

BUG: 433976
parent 5679a78e
......@@ -27,6 +27,7 @@ target_link_libraries(plasma-systemmonitor
KF5::KIOGui
KF5::GlobalAccel
KF5::DBusAddons
KF5::QuickAddons
)
install(TARGETS plasma-systemmonitor DESTINATION ${KDE_INSTALL_BINDIR})
......
......@@ -17,6 +17,7 @@
#include <KDBusService>
#include <KDeclarative/KDeclarative>
#include <KLocalizedString>
#include <KQuickAddons/QtQuickSettings>
#include "Configuration.h"
#include "ToolsModel.h"
......@@ -114,10 +115,10 @@ int main(int argc, char **argv)
return new CommandLineArguments{parser};
});
QQmlApplicationEngine engine;
KQuickAddons::QtQuickSettings::init();
QQmlApplicationEngine engine;
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
engine.load(QStringLiteral(":/main.qml"));
QObject::connect(&service, &KDBusService::activateRequested, &engine, []() {
......
......@@ -24,6 +24,8 @@ Kirigami.ApplicationWindow {
title: (pageStack.currentItem ? pageStack.currentItem.title + " - " : "") + i18n("System Monitor")
header: contentItem.GraphicsInfo.api == GraphicsInfo.Software ? degradedWarning.createObject(app) : null
Kirigami.PagePool {
id: pagePoolObject
}
......@@ -258,5 +260,18 @@ Kirigami.ApplicationWindow {
property alias hiddenPages: pagesModel.hiddenPages
}
Component {
id: degradedWarning
ToolBar {
Kirigami.InlineMessage {
anchors.fill: parent
visible: true
type: Kirigami.MessageType.Warning
text: i18n("System Monitor is running in degraded mode. This means that certain things may not display or display incorrectly. Please check your setup.")
}
}
}
pageStack.columnView.columnWidth: Kirigami.Units.gridUnit * 17
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment