!22 fix(display): vnc crashed
From: @tanyulong2021 Reviewed-by: @dou33 Signed-off-by: @dou33
This commit is contained in:
commit
e615f13676
86
0007-fix-vnc-crashed.patch
Normal file
86
0007-fix-vnc-crashed.patch
Normal file
@ -0,0 +1,86 @@
|
||||
From 575c32022d326eb391054c0608d5fc82cebb9281 Mon Sep 17 00:00:00 2001
|
||||
From: tanyulong <tanyulong@kylinos.cn>
|
||||
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 <KF5/KScreen/kscreen/getconfigoperation.h>
|
||||
#include <KF5/KScreen/kscreen/output.h>
|
||||
#include <QDebug>
|
||||
+#include <QDBusInterface>
|
||||
+#include <QDBusConnection>
|
||||
|
||||
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<KScreen::GetConfigOperation*>(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
|
||||
|
||||
@ -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<tanyulong@kylinos.cn> - 3.0.1-7
|
||||
- fix vnc crashed
|
||||
|
||||
* Thu Jul 08 2021 tanyulong<tanyulong@kylinos.cn> - 3.0.1-6
|
||||
- fix-Group-members-are-not-displayed
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user