fix(display): Add adaptive screen change flag
- 添加自适应屏幕变化的标志 Signed-off-by: huangjiawen <huangjiawen@kylinsec.com.cn>
This commit is contained in:
parent
1f3af5c5ee
commit
1e8c5e841a
59
0001-fix-display-Add-adaptive-screen-change-flag.patch
Normal file
59
0001-fix-display-Add-adaptive-screen-change-flag.patch
Normal file
@ -0,0 +1,59 @@
|
||||
From a3f33d4f38ccb786f3336e30db72741f1781cb57 Mon Sep 17 00:00:00 2001
|
||||
From: huangjiawen <huangjiawen@kylinsec.com.cn>
|
||||
Date: Mon, 29 May 2023 14:40:59 +0800
|
||||
Subject: [PATCH] fix(display): Add adaptive screen change flag
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 添加自适应屏幕变化的标志
|
||||
|
||||
Signed-off-by: huangjiawen <huangjiawen@kylinsec.com.cn>
|
||||
---
|
||||
data/schemas/com.kylinsec.kiran.display.gschema.xml.in | 6 ++++++
|
||||
plugins/display/display-manager.cpp | 5 ++++-
|
||||
2 files changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/data/schemas/com.kylinsec.kiran.display.gschema.xml.in b/data/schemas/com.kylinsec.kiran.display.gschema.xml.in
|
||||
index ea752a8..7c4930f 100644
|
||||
--- a/data/schemas/com.kylinsec.kiran.display.gschema.xml.in
|
||||
+++ b/data/schemas/com.kylinsec.kiran.display.gschema.xml.in
|
||||
@@ -18,5 +18,11 @@
|
||||
<default>false</default>
|
||||
<description>It takes effect immediately when the scaling factor of window is changed.</description>
|
||||
</key>
|
||||
+
|
||||
+ <key name="screen-changed-adaptation" type="b">
|
||||
+ <default>true</default>
|
||||
+ <description>Set whether to adapt to screen changes </description>
|
||||
+ </key>
|
||||
+
|
||||
</schema>
|
||||
</schemalist>
|
||||
diff --git a/plugins/display/display-manager.cpp b/plugins/display/display-manager.cpp
|
||||
index 244006e..0860253 100644
|
||||
--- a/plugins/display/display-manager.cpp
|
||||
+++ b/plugins/display/display-manager.cpp
|
||||
@@ -26,6 +26,7 @@ namespace Kiran
|
||||
{
|
||||
#define DISPLAY_SCHEMA_ID "com.kylinsec.kiran.display"
|
||||
#define DISPLAY_SCHEMA_STYLE "display-style"
|
||||
+#define SCREEN_CHANGED_ADAPT "screen-changed-adaptation"
|
||||
|
||||
#define DISPLAY_CONF_DIR "kylinsec/" PROJECT_NAME "/display"
|
||||
#define DISPLAY_FILE_NAME "display.xml"
|
||||
@@ -859,8 +860,10 @@ void DisplayManager::resources_changed()
|
||||
this->load_monitors();
|
||||
auto new_monitors_uid = this->get_monitors_uid();
|
||||
|
||||
+ auto screen_changed_adaptation = this->display_settings_->get_boolean(SCREEN_CHANGED_ADAPT);
|
||||
+
|
||||
// 如果uid不相同,说明设备硬件发生了变化,此时需要重新进行设置
|
||||
- if (old_monitors_uid != new_monitors_uid)
|
||||
+ if (screen_changed_adaptation && old_monitors_uid != new_monitors_uid)
|
||||
{
|
||||
CCErrorCode error_code = CCErrorCode::SUCCESS;
|
||||
if (!this->switch_style_and_save(this->default_style_, error_code))
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: kiran-cc-daemon
|
||||
Version: 2.5.1
|
||||
Release: 10
|
||||
Release: 11
|
||||
Summary: DBus daemon for Kiran Desktop
|
||||
|
||||
License: MulanPSL-2.0
|
||||
@ -13,6 +13,7 @@ Patch0004: 0001-feature-timedate-Prior-to-select-last-ntp-service-in.patch
|
||||
Patch0005: 0001-feature-power-Delete-LockScreenWhenHibernate-and-Loc.patch
|
||||
Patch0006: 0001-fix-identification-issues-in-control-centers.patch
|
||||
Patch0007: 0001-fix-keybinding-Add-support-desktop-key-for-GC.patch
|
||||
Patch0008: 0001-fix-display-Add-adaptive-screen-change-flag.patch
|
||||
|
||||
|
||||
BuildRequires: cmake >= 3.2
|
||||
@ -183,6 +184,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || :
|
||||
%{_libdir}/pkgconfig/kiran-cc-daemon.pc
|
||||
|
||||
%changelog
|
||||
* Tue May 30 2023 huangjiawen <huangjiawen@kylinsec.com.cn> - 2.5.1-11
|
||||
- KYOS-F: Add adaptive screen change flag
|
||||
|
||||
* Tue May 30 2023 meizhigang <meizhigang@kylinsec.com.cn> - 2.5.1-10
|
||||
- KYOS-F: Add support desktop extend key for GC
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user