From b4e6ca0df6e909f2f77dd458c3fcc6ea4c1780f5 Mon Sep 17 00:00:00 2001 From: tanyulong2021 Date: Fri, 9 Jul 2021 17:07:45 +0800 Subject: [PATCH] fix(display): vnc crashed --- 0007-fix-vnc-crashed.patch | 86 ++++++++++++++++++++++++++++++++++++++ ukui-control-center.spec | 7 +++- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 0007-fix-vnc-crashed.patch diff --git a/0007-fix-vnc-crashed.patch b/0007-fix-vnc-crashed.patch new file mode 100644 index 0000000..7e1a435 --- /dev/null +++ b/0007-fix-vnc-crashed.patch @@ -0,0 +1,86 @@ +From 575c32022d326eb391054c0608d5fc82cebb9281 Mon Sep 17 00:00:00 2001 +From: tanyulong +Date: Fri, 9 Jul 2021 16:55:22 +0800 +Subject: [PATCH] fix vnc crashed + +--- + plugins/system/display/display.cpp | 30 ++++++++++++++++++++++++++++++ + plugins/system/display/display.h | 4 +++- + 2 files changed, 33 insertions(+), 1 deletion(-) + +diff --git a/plugins/system/display/display.cpp b/plugins/system/display/display.cpp +index de931b6..383c564 100755 +--- a/plugins/system/display/display.cpp ++++ b/plugins/system/display/display.cpp +@@ -25,6 +25,8 @@ + #include + #include + #include ++#include ++#include + + DisplaySet::DisplaySet(){ + pluginWidget = new Widget; +@@ -43,6 +45,15 @@ DisplaySet::~DisplaySet(){ + } + + QWidget *DisplaySet::get_plugin_ui(){ ++ if (mFirstLoad) { ++ requestBackend(); ++ mFirstLoad = false; ++ pluginWidget = new Widget; ++ QObject::connect(new KScreen::GetConfigOperation(), &KScreen::GetConfigOperation::finished, ++ [&](KScreen::ConfigOperation *op) { ++ pluginWidget->setConfig(qobject_cast(op)->config()); ++ }); ++ } + return pluginWidget; + } + +@@ -63,3 +74,22 @@ const QString DisplaySet::name() const { + return QStringLiteral("display"); + } + ++void DisplaySet::requestBackend() { ++ ++ QDBusInterface screenIft("org.kde.KScreen", ++ "/", ++ "org.kde.KScreen", ++ QDBusConnection::sessionBus()); ++ if (!screenIft.isValid()) { ++ QProcess process; ++ process.start("uname -m"); ++ process.waitForFinished(); ++ QString output = process.readAll(); ++ output = output.simplified(); ++ ++ QString command = "/usr/lib/" + output + "-linux-gnu" +"/libexec/kf5/kscreen_backend_launcher"; ++ QProcess::startDetached(command); ++ } ++} ++ ++ +diff --git a/plugins/system/display/display.h b/plugins/system/display/display.h +index e4f4fbd..b30e9bb 100755 +--- a/plugins/system/display/display.h ++++ b/plugins/system/display/display.h +@@ -47,13 +47,15 @@ public: + void plugin_delay_control() Q_DECL_OVERRIDE; + const QString name() const Q_DECL_OVERRIDE; + +- ++private: ++ void requestBackend(); + private: + Ui::DisplayWindow * ui; + QString pluginName; + int pluginType; + Widget * pluginWidget; + ++ bool mFirstLoad; + }; + + #endif // DISPLAYSET_H +-- +2.23.0 + diff --git a/ukui-control-center.spec b/ukui-control-center.spec index 90e0784..b597d30 100644 --- a/ukui-control-center.spec +++ b/ukui-control-center.spec @@ -1,7 +1,7 @@ %define debug_package %{nil} Name: ukui-control-center Version: 3.0.1 -Release: 6 +Release: 7 Summary: utilities to configure the UKUI desktop License: GPL-2+ URL: http://www.ukui.org @@ -76,6 +76,7 @@ patch3: 0004-fix-effects-mode-not-available-bug.patch patch4: 0005-fix-blueman-tray-and-groupadd-autologin.patch patch5: 0001-add-judgment-when-Bluetooth-does-not-exist.patch patch6: 0006-fix-Group-members-are-not-displayed.patch +patch7: 0007-fix-vnc-crashed.patch Recommends: qt5-qtquickcontrols @@ -103,6 +104,7 @@ Suggests: ukui-settings-daemon %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 %build qmake-qt5 @@ -146,6 +148,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/polkit-1/actions/org.ukui.groupmanager.policy %changelog +* Fri Jul 09 2021 tanyulong - 3.0.1-7 +- fix vnc crashed + * Thu Jul 08 2021 tanyulong - 3.0.1-6 - fix-Group-members-are-not-displayed