From 161f86eb45471a328c5f0538324ba8f9f7bc39bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 20 Jun 2023 18:31:44 +0800 Subject: [PATCH] DisplayServer (Linux): add fast path of kde version detection for Fedora --- src/detection/displayserver/linux/wmde.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/detection/displayserver/linux/wmde.c b/src/detection/displayserver/linux/wmde.c index 3b9b50ebf..12c9185bf 100644 --- a/src/detection/displayserver/linux/wmde.c +++ b/src/detection/displayserver/linux/wmde.c @@ -125,13 +125,24 @@ static void getKDE(const FFinstance* instance, FFDisplayServerResult* result) ffStrbufSetS(&result->deProcessName, "plasmashell"); ffStrbufSetS(&result->dePrettyName, FF_DE_PRETTY_PLASMA); - ffParsePropFileData(instance, "xsessions/plasma.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); + ffParsePropFileValues("/usr/share/xsessions/plasmax11.desktop", 1, (FFpropquery[]) { + {"X-KDE-PluginInfo-Version =", &result->deVersion} + }); + if(result->deVersion.length == 0) + ffParsePropFileData(instance, "xsessions/plasma.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); if(result->deVersion.length == 0) ffParsePropFileData(instance, "xsessions/plasma5.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); + if(result->deVersion.length == 0) + { + ffParsePropFileValues("/usr/share/wayland-sessions/plasma.desktop", 1, (FFpropquery[]) { + {"X-KDE-PluginInfo-Version =", &result->deVersion} + }); + } if(result->deVersion.length == 0) ffParsePropFileData(instance, "wayland-sessions/plasmawayland.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); if(result->deVersion.length == 0) ffParsePropFileData(instance, "wayland-sessions/plasmawayland5.desktop", "X-KDE-PluginInfo-Version =", &result->deVersion); + if(result->deVersion.length == 0 && instance->config.allowSlowOperations) { if (ffProcessAppendStdOut(&result->deVersion, (char* const[]){