!30 修复由于保存的显示器状态全部为关闭导致显示器不显示的问题

From: @tangjie02 
Reviewed-by: @liubuguiii 
Signed-off-by: @liubuguiii
This commit is contained in:
openeuler-ci-bot 2022-08-18 05:44:30 +00:00 committed by Gitee
commit 496d5c1915
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,37 @@
From 77032b5c643437c286f13ecb4fcc4ff9c9419b9d Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Wed, 17 Aug 2022 20:26:02 +0800
Subject: [PATCH] fix(display): Fix the problem that all monitors doesn't
display because the saved enable field of all monitors is set off.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复由于保存的显示器状态全部为关闭导致显示器不显示的问题
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
plugins/display/display-manager.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/plugins/display/display-manager.cpp b/plugins/display/display-manager.cpp
index 5c7c5b3..bc18eb9 100644
--- a/plugins/display/display-manager.cpp
+++ b/plugins/display/display-manager.cpp
@@ -499,6 +499,13 @@ bool DisplayManager::save_config(CCErrorCode &error_code)
this->display_config_ = std::unique_ptr<DisplayConfigInfo>(new DisplayConfigInfo());
}
+ // 禁止保存没有开启任何显示器的配置,这可能会导致下次进入会话屏幕无法显示
+ if (this->get_enabled_monitors().size() == 0)
+ {
+ error_code = CCErrorCode::ERROR_DISPLAY_ONLY_ONE_ENABLED_MONITOR;
+ return false;
+ }
+
auto monitors_uid = this->get_monitors_uid();
auto &c_screens = this->display_config_->screen();
bool matched = false;
--
2.33.0

View File

@ -1,6 +1,6 @@
Name: kiran-cc-daemon
Version: 2.3.1
Release: 4
Release: 5
Summary: DBus daemon for Kiran Desktop
License: MulanPSL-2.0
@ -9,6 +9,7 @@ Source0: %{name}-%{version}.tar.gz
Patch0001: 0001-fix-coredump-Fix-coredump-problem-caused-by-nullpoin.patch
Patch0002: 0001-fix-hidpi-Fixed-QT-font-DPI-to-avoid-double-scaling.patch
Patch0003: 0001-feature-display-The-scaling-rate-can-only-take-effec.patch
patch0004: 0001-fix-display-Fix-the-problem-that-all-monitors-doesn-.patch
BuildRequires: cmake >= 3.2
@ -148,6 +149,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || :
%{_libdir}/pkgconfig/kiran-cc-daemon.pc
%changelog
* Wed Aug 17 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-5
- KYOS-B: Fix the problem that all monitors doesn't display because the saved enable field of all monitors is set off.
* Tue Aug 16 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-4
- KYOS-F: The scaling rate can only take effect after logging out and logging in again.