!36 更新到v2.4版本

From: @tangjie02 
Reviewed-by: @liubuguiii 
Signed-off-by: @liubuguiii
This commit is contained in:
openeuler-ci-bot 2022-10-26 01:09:02 +00:00 committed by Gitee
commit a5543aebec
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
11 changed files with 12 additions and 1957 deletions

View File

@ -1,795 +0,0 @@
From 1137721a530370a171ea437dafa369384d414348 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Tue, 16 Aug 2022 17:54:17 +0800
Subject: [PATCH] feature(display): The scaling rate can only take effect after
logging out and logging in again.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 缩放率改为默认注销后重新登录才能生效
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
.../com.kylinsec.kiran.display.gschema.xml.in | 4 +
include/display_i.h | 2 +
plugins/display/display-manager.cpp | 80 ++++++-----
plugins/display/display-manager.h | 3 +-
...kylinsec.Kiran.SessionDaemon.XSettings.xml | 7 +
plugins/xsettings/xsettings-manager.cpp | 11 +-
plugins/xsettings/xsettings-manager.h | 1 +
plugins/xsettings/xsettings-registry.cpp | 18 ++-
plugins/xsettings/xsettings-registry.h | 9 +-
po/POTFILES.in | 12 +-
po/zh_CN.po | 132 ++++++++++--------
11 files changed, 168 insertions(+), 111 deletions(-)
diff --git a/data/schemas/com.kylinsec.kiran.display.gschema.xml.in b/data/schemas/com.kylinsec.kiran.display.gschema.xml.in
index 536f3c4..ea752a8 100644
--- a/data/schemas/com.kylinsec.kiran.display.gschema.xml.in
+++ b/data/schemas/com.kylinsec.kiran.display.gschema.xml.in
@@ -14,5 +14,9 @@
<description>Layout of connected monitors in the screen.</description>
</key>
+ <key name="dynamic-scaling-window" type="b">
+ <default>false</default>
+ <description>It takes effect immediately when the scaling factor of window is changed.</description>
+ </key>
</schema>
</schemalist>
diff --git a/include/display_i.h b/include/display_i.h
index 56ef7b1..0b6bc17 100644
--- a/include/display_i.h
+++ b/include/display_i.h
@@ -39,6 +39,8 @@ extern "C"
#define DISPLAY_OBJECT_PATH "/com/kylinsec/Kiran/SessionDaemon/Display"
#define DISPLAY_DBUS_INTERFACE_NAME "com.kylinsec.Kiran.SessionDaemon.Display"
+#define DISPLAY_SCHEMA_DYNAMIC_SCALING_WINDOW "dynamic-scaling-window"
+
// 显示模式,只有在下列情况会使用显示模式进行设置:
// 1. 程序第一次启动
// 2. 有连接设备删除和添加时
diff --git a/plugins/display/display-manager.cpp b/plugins/display/display-manager.cpp
index ff9151f..5c7c5b3 100644
--- a/plugins/display/display-manager.cpp
+++ b/plugins/display/display-manager.cpp
@@ -16,6 +16,7 @@
#include <fstream>
+#include <glib/gi18n.h>
#include "config.h"
#include "lib/base/base.h"
#include "plugins/display/display-util.h"
@@ -34,6 +35,8 @@ namespace Kiran
DisplayManager::DisplayManager(XrandrManager *xrandr_manager) : xrandr_manager_(xrandr_manager),
default_style_(DisplayStyle::DISPLAY_STYLE_EXTEND),
+ window_scaling_factor_(0),
+ dynamic_scaling_window_(false),
dbus_connect_id_(0),
object_register_id_(0)
{
@@ -180,10 +183,28 @@ void DisplayManager::SetWindowScalingFactor(gint32 window_scaling_factor, Method
{
KLOG_PROFILE("");
+ if (this->window_scaling_factor_get() == window_scaling_factor)
+ {
+ invocation.ret();
+ return;
+ }
+
+ if (!this->dynamic_scaling_window_)
+ {
+ std::string standard_error;
+ auto command_line = fmt::format("/usr/bin/notify-send \"{0}\"", _("The scaling rate can only take effect after logging out and logging in again"));
+ Glib::spawn_command_line_sync(command_line, nullptr, &standard_error);
+ if (!standard_error.empty())
+ {
+ KLOG_WARNING("Failed to run notify-send: %s", standard_error.c_str());
+ }
+ }
+
if (!this->window_scaling_factor_set(window_scaling_factor))
{
DBUS_ERROR_REPLY_AND_RET(CCErrorCode::ERROR_DISPLAY_SET_WINDOW_SCALING_FACTOR_2);
}
+
invocation.ret();
}
@@ -222,7 +243,6 @@ void DisplayManager::init()
this->load_config();
this->display_settings_->signal_changed().connect(sigc::mem_fun(this, &DisplayManager::display_settings_changed));
- this->xsettings_settings_->signal_changed().connect(sigc::mem_fun(this, &DisplayManager::xsettings_settings_changed));
this->xrandr_manager_->signal_resources_changed().connect(sigc::mem_fun(this, &DisplayManager::resources_changed));
this->dbus_connect_id_ = Gio::DBus::own_name(Gio::DBus::BUS_TYPE_SESSION,
@@ -236,21 +256,25 @@ void DisplayManager::init()
{
KLOG_WARNING("%s.", CC_ERROR2STR(error_code).c_str());
}
+
+ /* window_scaling_factor的初始化顺序
+ 1. 先读取xsettings中的window-scaling-factor属性; (load_settings)
+ 2. 读取monitor.xml中维护的window-scaling-factor值 switch_style_and_save
+ 3. 如果第2步和第1步的值不相同则说明在上一次进入会话时用户修改了缩放率需要在这一次进入会话时生效
+ 因此需要将monitor.xml中的缩放率更新到xsettings中的window-scaling-factor属性中*/
+ if (this->window_scaling_factor_ != this->xsettings_settings_->get_int(XSETTINGS_SCHEMA_WINDOW_SCALING_FACTOR))
+ {
+ this->xsettings_settings_->set_int(XSETTINGS_SCHEMA_WINDOW_SCALING_FACTOR, this->window_scaling_factor_);
+ }
}
void DisplayManager::load_settings()
{
KLOG_PROFILE("settings: %p.", this->display_settings_.get());
- if (this->display_settings_)
- {
- this->default_style_ = DisplayStyle(this->display_settings_->get_enum(DISPLAY_SCHEMA_STYLE));
- }
-
- if (this->xsettings_settings_)
- {
- this->window_scaling_factor_ = this->xsettings_settings_->get_int(XSETTINGS_SCHEMA_WINDOW_SCALING_FACTOR);
- }
+ this->default_style_ = DisplayStyle(this->display_settings_->get_enum(DISPLAY_SCHEMA_STYLE));
+ this->dynamic_scaling_window_ = this->display_settings_->get_boolean(DISPLAY_SCHEMA_DYNAMIC_SCALING_WINDOW);
+ this->window_scaling_factor_ = this->xsettings_settings_->get_int(XSETTINGS_SCHEMA_WINDOW_SCALING_FACTOR);
}
void DisplayManager::load_monitors()
@@ -505,12 +529,15 @@ bool DisplayManager::save_config(CCErrorCode &error_code)
bool DisplayManager::apply(CCErrorCode &error_code)
{
- // 应用缩放因子
- auto variant_value = Glib::Variant<gint32>::create(this->window_scaling_factor_);
- if (!this->xsettings_settings_->set_value(XSETTINGS_SCHEMA_WINDOW_SCALING_FACTOR, variant_value))
+ if (this->dynamic_scaling_window_)
{
- error_code = CCErrorCode::ERROR_DISPLAY_SET_WINDOW_SCALING_FACTOR_1;
- return false;
+ // 应用缩放因子
+ auto variant_value = Glib::Variant<gint32>::create(this->window_scaling_factor_);
+ if (!this->xsettings_settings_->set_value(XSETTINGS_SCHEMA_WINDOW_SCALING_FACTOR, variant_value))
+ {
+ error_code = CCErrorCode::ERROR_DISPLAY_SET_WINDOW_SCALING_FACTOR_1;
+ return false;
+ }
}
// 应用xrandr
@@ -652,10 +679,11 @@ ModeInfoVec DisplayManager::monitors_common_modes(const DisplayMonitorVec &monit
for (uint32_t i = 1; i < monitors.size(); ++i)
{
auto monitor = monitors[i];
- auto iter = std::remove_if(result.begin(), result.end(), [monitor](std::shared_ptr<ModeInfo> mode) -> bool {
- auto modes = monitor->get_modes_by_size(mode->width, mode->height);
- return (modes.size() == 0);
- });
+ auto iter = std::remove_if(result.begin(), result.end(), [monitor](std::shared_ptr<ModeInfo> mode) -> bool
+ {
+ auto modes = monitor->get_modes_by_size(mode->width, mode->height);
+ return (modes.size() == 0);
+ });
result.erase(iter, result.end());
}
@@ -829,20 +857,6 @@ void DisplayManager::display_settings_changed(const Glib::ustring &key)
}
}
-void DisplayManager::xsettings_settings_changed(const Glib::ustring &key)
-{
- KLOG_PROFILE("key: %s.", key.c_str());
-
- switch (shash(key.c_str()))
- {
- case CONNECT(XSETTINGS_SCHEMA_WINDOW_SCALING_FACTOR, _hash):
- {
- this->window_scaling_factor_ = this->xsettings_settings_->get_int(key);
- }
- break;
- }
-}
-
void DisplayManager::on_bus_acquired(const Glib::RefPtr<Gio::DBus::Connection> &connect, Glib::ustring name)
{
KLOG_PROFILE("name: %s", name.c_str());
diff --git a/plugins/display/display-manager.h b/plugins/display/display-manager.h
index 1dbb50d..773fe90 100644
--- a/plugins/display/display-manager.h
+++ b/plugins/display/display-manager.h
@@ -120,7 +120,6 @@ private:
void resources_changed();
void display_settings_changed(const Glib::ustring& key);
- void xsettings_settings_changed(const Glib::ustring& key);
void on_bus_acquired(const Glib::RefPtr<Gio::DBus::Connection>& connect, Glib::ustring name);
void on_name_acquired(const Glib::RefPtr<Gio::DBus::Connection>& connect, Glib::ustring name);
@@ -142,6 +141,8 @@ private:
std::string primary_;
// 窗口缩放率
int32_t window_scaling_factor_;
+ // 开启动态缩放窗口
+ bool dynamic_scaling_window_;
std::map<uint32_t, std::shared_ptr<DisplayMonitor>> monitors_;
diff --git a/plugins/xsettings/com.kylinsec.Kiran.SessionDaemon.XSettings.xml b/plugins/xsettings/com.kylinsec.Kiran.SessionDaemon.XSettings.xml
index d9a23da..cbe1b43 100644
--- a/plugins/xsettings/com.kylinsec.Kiran.SessionDaemon.XSettings.xml
+++ b/plugins/xsettings/com.kylinsec.Kiran.SessionDaemon.XSettings.xml
@@ -70,5 +70,12 @@
<description>Set the XSettings Registry value whose type is color.</description>
</method>
+ <signal name="PropertiesChanged">
+ <arg type="as" name="names">
+ <summary>The XSettings Registry property name list.</summary>
+ </arg>
+ <description>Emit this signal when XSettings Registry property is changed.</description>
+ </signal>
+
</interface>
</node>
diff --git a/plugins/xsettings/xsettings-manager.cpp b/plugins/xsettings/xsettings-manager.cpp
index 9612a85..61c914b 100644
--- a/plugins/xsettings/xsettings-manager.cpp
+++ b/plugins/xsettings/xsettings-manager.cpp
@@ -190,6 +190,7 @@ void XSettingsManager::init()
screen->signal_size_changed().connect(sigc::mem_fun(this, &XSettingsManager::on_screen_changed));
screen->signal_monitors_changed().connect(sigc::mem_fun(this, &XSettingsManager::on_screen_changed));
this->fontconfig_monitor_.signal_timestamp_changed().connect(sigc::mem_fun(this, &XSettingsManager::on_fontconfig_timestamp_changed));
+ this->registry_.signal_properties_changed().connect(sigc::mem_fun(this, &XSettingsManager::on_properties_changed));
this->dbus_connect_id_ = Gio::DBus::own_name(Gio::DBus::BUS_TYPE_SESSION,
XSETTINGS_DBUS_NAME,
@@ -207,8 +208,6 @@ void XSettingsManager::load_from_settings()
// 这里不做通知,等初始化完后统一通知
this->settings_changed(key, false);
}
- // 这里统一通知
- this->registry_.notify();
}
void XSettingsManager::settings_changed(const Glib::ustring &key, bool is_notify)
@@ -300,7 +299,6 @@ void XSettingsManager::settings_changed(const Glib::ustring &key, bool is_notify
if (is_notify)
{
this->xsettings_changed_.emit(key.raw());
- this->registry_.notify();
}
}
@@ -406,7 +404,6 @@ void XSettingsManager::on_screen_changed()
{
this->scale_settings();
}
- this->registry_.notify();
}
bool XSettingsManager::delayed_toggle_bg_draw(bool value)
@@ -423,7 +420,11 @@ void XSettingsManager::on_fontconfig_timestamp_changed()
{
int32_t timestamp = time(NULL);
this->registry_.update(XSETTINGS_REGISTRY_PROP_FONTCONFIG_TIMESTAMP, timestamp);
- this->registry_.notify();
+}
+
+void XSettingsManager::on_properties_changed(const std::vector<Glib::ustring> &properties)
+{
+ this->PropertiesChanged_signal.emit(properties);
}
void XSettingsManager::set_registry_var(std::shared_ptr<XSettingsPropertyBase> var, MethodInvocation &invocation)
diff --git a/plugins/xsettings/xsettings-manager.h b/plugins/xsettings/xsettings-manager.h
index 84e5c55..ce69ef9 100644
--- a/plugins/xsettings/xsettings-manager.h
+++ b/plugins/xsettings/xsettings-manager.h
@@ -68,6 +68,7 @@ private:
void on_screen_changed();
bool delayed_toggle_bg_draw(bool value);
void on_fontconfig_timestamp_changed();
+ void on_properties_changed(const std::vector<Glib::ustring> &properties);
void set_registry_var(std::shared_ptr<XSettingsPropertyBase> var, MethodInvocation &invocation);
diff --git a/plugins/xsettings/xsettings-registry.cpp b/plugins/xsettings/xsettings-registry.cpp
index bd95671..13472de 100644
--- a/plugins/xsettings/xsettings-registry.cpp
+++ b/plugins/xsettings/xsettings-registry.cpp
@@ -236,8 +236,15 @@ bool XSettingsRegistry::update(std::shared_ptr<XSettingsPropertyBase> var)
return true;
}
+ this->changed_properties_.push_back(var->get_name());
this->properties_.erase(var->get_name());
auto iter = this->properties_.emplace(var->get_name(), var);
+
+ // 空闲时修改因为update可能会被连续调用多次。
+ if (!this->notify_handler_)
+ {
+ this->notify_handler_ = Glib::signal_idle().connect(sigc::mem_fun(this, &XSettingsRegistry::notify));
+ }
return iter.second;
}
@@ -261,9 +268,10 @@ XSettingsPropertyBaseVec XSettingsRegistry::get_properties()
return retval;
}
-void XSettingsRegistry::notify()
+bool XSettingsRegistry::notify()
{
- KLOG_PROFILE("");
+ KLOG_DEBUG("Notify properties changed to other client.");
+
std::string data;
// 注意:填充的相关变量类型不能随意修改
@@ -276,7 +284,6 @@ void XSettingsRegistry::notify()
data.append(std::string((char *)&nsettings, 4));
// 填充body
-
for (const auto &iter : this->properties_)
{
data.append(iter.second->serialize());
@@ -290,6 +297,11 @@ void XSettingsRegistry::notify()
PropModeReplace,
(unsigned char *)data.c_str(),
data.length());
+
+ auto changed_properties = std::move(this->changed_properties_);
+ this->properties_changed_.emit(changed_properties);
+
+ return false;
}
char XSettingsRegistry::byte_order()
diff --git a/plugins/xsettings/xsettings-registry.h b/plugins/xsettings/xsettings-registry.h
index 8a39051..d8aa238 100644
--- a/plugins/xsettings/xsettings-registry.h
+++ b/plugins/xsettings/xsettings-registry.h
@@ -126,12 +126,13 @@ public:
bool update(const std::string &name, const XSettingsColor &value);
bool update(std::shared_ptr<XSettingsPropertyBase> var);
- void notify();
-
std::shared_ptr<XSettingsPropertyBase> get_property(const std::string &name);
XSettingsPropertyBaseVec get_properties();
+ sigc::signal<void, std::vector<Glib::ustring>> signal_properties_changed() { return this->properties_changed_; };
+
private:
+ bool notify();
char byte_order();
private:
@@ -146,5 +147,9 @@ private:
Window xsettings_window_;
std::map<std::string, std::shared_ptr<XSettingsPropertyBase>> properties_;
+ // 记录发生变化的属性,在改变后发送信号
+ std::vector<Glib::ustring> changed_properties_;
+ sigc::connection notify_handler_;
+ sigc::signal<void, std::vector<Glib::ustring>> properties_changed_;
};
} // namespace Kiran
\ No newline at end of file
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a12d2d9..5defca8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,11 +1,11 @@
# List of source files which contain translatable strings.
[encoding: UTF-8]
-[type: gettext/gsettings]data/com.kylinsec.kiran.appearance.gschema.xml.in
-[type: gettext/gsettings]data/com.kylinsec.kiran.display.gschema.xml.in
-[type: gettext/gsettings]data/com.kylinsec.kiran.keyboard.gschema.xml.in
-[type: gettext/gsettings]data/com.kylinsec.kiran.mouse.gschema.xml.in
-[type: gettext/gsettings]data/com.kylinsec.kiran.touchpad.gschema.xml.in
-[type: gettext/gsettings]data/com.kylinsec.kiran.xsettings.gschema.xml.in
+[type: gettext/gsettings]data/schemas/com.kylinsec.kiran.appearance.gschema.xml.in
+[type: gettext/gsettings]data/schemas/com.kylinsec.kiran.display.gschema.xml.in
+[type: gettext/gsettings]data/schemas/com.kylinsec.kiran.keyboard.gschema.xml.in
+[type: gettext/gsettings]data/schemas/com.kylinsec.kiran.mouse.gschema.xml.in
+[type: gettext/gsettings]data/schemas/com.kylinsec.kiran.touchpad.gschema.xml.in
+[type: gettext/gsettings]data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in
data/com.kylinsec.Kiran.SystemDaemon.Accounts.policy.in
data/com.kylinsec.Kiran.SystemDaemon.TimeDate.policy.in
data/com.kylinsec.Kiran.SystemDaemon.Greeter.policy.in
diff --git a/po/zh_CN.po b/po/zh_CN.po
index c9f2652..0f3f202 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kiran-cc-daemon 2.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-06-08 11:05+0800\n"
+"POT-Creation-Date: 2022-08-16 17:47+0800\n"
"PO-Revision-Date: 2020-07-01 17:54+0800\n"
"Last-Translator: tangjie02 <tangjie02@kylinos.com.cn>\n"
"Language-Team: Chinese (simplified)\n"
@@ -17,58 +17,63 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: ../data/com.kylinsec.kiran.appearance.gschema.xml.in.h:1
+#: ../data/schemas/com.kylinsec.kiran.appearance.gschema.xml.in.h:1
msgid "File to use for the desktop background image."
msgstr "桌面背景图片的文件路径。"
-#: ../data/com.kylinsec.kiran.appearance.gschema.xml.in.h:2
+#: ../data/schemas/com.kylinsec.kiran.appearance.gschema.xml.in.h:2
msgid "File to use for the lock screen background image."
msgstr "锁屏背景图片的文件路径。"
-#: ../data/com.kylinsec.kiran.display.gschema.xml.in.h:1
+#: ../data/schemas/com.kylinsec.kiran.display.gschema.xml.in.h:1
msgid "Layout of connected monitors in the screen."
msgstr "已连接的显示器在屏幕中的位置布局。"
-#: ../data/com.kylinsec.kiran.keyboard.gschema.xml.in.h:1
+#: ../data/schemas/com.kylinsec.kiran.display.gschema.xml.in.h:2
+msgid ""
+"It takes effect immediately when the scaling factor of window is changed."
+msgstr "当窗口缩放率发生变化时立即生效。"
+
+#: ../data/schemas/com.kylinsec.kiran.keyboard.gschema.xml.in.h:1
msgid ""
"Whether repeat to trigger KeyPress and KeyRelease event when key is pressed."
msgstr "当键被长按后是否重复触发按下和弹起事件。"
-#: ../data/com.kylinsec.kiran.keyboard.gschema.xml.in.h:2
+#: ../data/schemas/com.kylinsec.kiran.keyboard.gschema.xml.in.h:2
msgid ""
"The delay time in ms after the initial press of an auto-repeating key and "
"the first generated repeat event."
msgstr "当键被按下时第一次触发按下事件的延时(毫秒)。"
-#: ../data/com.kylinsec.kiran.keyboard.gschema.xml.in.h:3
+#: ../data/schemas/com.kylinsec.kiran.keyboard.gschema.xml.in.h:3
msgid "The delay time in ms between all subsequent generated repeat events."
msgstr "当键被按下后每个按键(按下或者弹起)事件之间的间隔时间。"
-#: ../data/com.kylinsec.kiran.keyboard.gschema.xml.in.h:4
+#: ../data/schemas/com.kylinsec.kiran.keyboard.gschema.xml.in.h:4
msgid "Keyboard layouts."
msgstr "键盘布局。"
-#: ../data/com.kylinsec.kiran.keyboard.gschema.xml.in.h:5
+#: ../data/schemas/com.kylinsec.kiran.keyboard.gschema.xml.in.h:5
msgid "Keyboard options."
msgstr "键盘选项。"
-#: ../data/com.kylinsec.kiran.mouse.gschema.xml.in.h:1
-#: ../data/com.kylinsec.kiran.touchpad.gschema.xml.in.h:1
+#: ../data/schemas/com.kylinsec.kiran.mouse.gschema.xml.in.h:1
+#: ../data/schemas/com.kylinsec.kiran.touchpad.gschema.xml.in.h:1
msgid "Swap left and right buttons for left-handed."
msgstr "启动左手模式后,左右键功能进行切换。"
-#: ../data/com.kylinsec.kiran.mouse.gschema.xml.in.h:2
+#: ../data/schemas/com.kylinsec.kiran.mouse.gschema.xml.in.h:2
msgid "Acceleration multiplier for mouse motion."
msgstr "鼠标移动加速。"
-#: ../data/com.kylinsec.kiran.mouse.gschema.xml.in.h:3
+#: ../data/schemas/com.kylinsec.kiran.mouse.gschema.xml.in.h:3
msgid ""
"Enables middle mouse button emulation through simultaneous left and right "
"button click."
msgstr "通过同时左键和右键启用鼠标中键模拟按钮点击。"
-#: ../data/com.kylinsec.kiran.mouse.gschema.xml.in.h:4
-#: ../data/com.kylinsec.kiran.touchpad.gschema.xml.in.h:6
+#: ../data/schemas/com.kylinsec.kiran.mouse.gschema.xml.in.h:4
+#: ../data/schemas/com.kylinsec.kiran.touchpad.gschema.xml.in.h:6
msgid ""
"Enables or disables natural scroll. Natural scrolling is the terminology for "
"moving the content in the direction of scrolling, i.e. moving the wheel or "
@@ -77,22 +82,22 @@ msgstr ""
"启用或禁用自然滚动。自然滚动是沿滚动方向移动内容,即移动滚轮或手指向下时页面"
"向下移动。"
-#: ../data/com.kylinsec.kiran.touchpad.gschema.xml.in.h:2
+#: ../data/schemas/com.kylinsec.kiran.touchpad.gschema.xml.in.h:2
msgid "Indicates if diable while typing is enabled or disabled."
msgstr "打字时禁用触摸板功能。"
-#: ../data/com.kylinsec.kiran.touchpad.gschema.xml.in.h:3
+#: ../data/schemas/com.kylinsec.kiran.touchpad.gschema.xml.in.h:3
msgid ""
"Set this to TRUE to be able to send mouse clicks by tapping on the touchpad."
msgstr "设置为真则表示轻击触摸板触发对应的鼠标事件,例如双击等同于鼠标右键。"
-#: ../data/com.kylinsec.kiran.touchpad.gschema.xml.in.h:4
+#: ../data/schemas/com.kylinsec.kiran.touchpad.gschema.xml.in.h:4
msgid ""
"Enables a click method. Permitted methods are buttonareas and clickfinger, "
"respectively conreesponding to 0 and 1."
msgstr "设置单击方法。可通过按下和轻触的方式触发点击事件。"
-#: ../data/com.kylinsec.kiran.touchpad.gschema.xml.in.h:5
+#: ../data/schemas/com.kylinsec.kiran.touchpad.gschema.xml.in.h:5
msgid ""
"Enables a scroll method. Permitted methods are twofinger, edge and button, "
"respectively conrresponding to 0, 1 and 2."
@@ -100,146 +105,146 @@ msgstr ""
"设置滚动方法。可通过双指滑动、边缘滑动和按键(键盘中间的红色按钮)的方式触发滚"
"动操作。"
-#: ../data/com.kylinsec.kiran.touchpad.gschema.xml.in.h:7
+#: ../data/schemas/com.kylinsec.kiran.touchpad.gschema.xml.in.h:7
msgid "Set this to TRUE to enable all touchpads."
msgstr "开启或关闭触摸板。"
-#: ../data/com.kylinsec.kiran.touchpad.gschema.xml.in.h:8
+#: ../data/schemas/com.kylinsec.kiran.touchpad.gschema.xml.in.h:8
msgid "Acceleration multiplier for touchpad motion."
msgstr "触摸板移动加速。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:1
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:1
msgid ""
"Maximum time allowed between two clicks for them to be considered a double "
"click (in milliseconds)."
msgstr "触发双击事件时两次单击之间允许的最大时间 (毫秒)。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:2
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:2
msgid ""
"Maximum distance allowed between two clicks for them to be considered a "
"double click (in pixels)."
msgstr "触发双击事件时两次单击之间允许的最大距离 (像素)。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:3
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:3
msgid "Number of pixels the cursor can move before dragging."
msgstr "拖动前光标可以移动的像素数。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:4
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:4
msgid "Whether the cursor should blink."
msgstr "光标是否应该闪烁。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:5
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:5
msgid "Length of the cursor blink cycle, in milleseconds."
msgstr "光标闪烁周期的长度 (毫秒)。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:6
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:6
msgid "Name of gtk theme to use."
msgstr "系统使用的主题。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:7
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:7
msgid "Name of icon theme to use for icons."
msgstr "系统使用的图标主题。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:8
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:8
msgid "Whether to play sounds on user events."
msgstr "是否在用户事件中播放声音。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:9
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:9
msgid "The XDG sound theme to use for event sounds."
msgstr "用于事件声音的XDG声音主题。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:10
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:10
msgid "Whether to play sounds on input events."
msgstr "是否在输入事件上播放声音。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:11
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:11
msgid "Whether to antialias Xft fonts; 0=no, 1=yes, -1=default."
msgstr "是否开启Xft字体抗锯齿-1表示默认值。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:12
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:12
msgid "Whether to hint Xft fonts; 0=no, 1=yes, -1=default."
msgstr "是否开启Xft字体微调-1表示默认值。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:13
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:13
msgid ""
"What degree of hinting to use; \"hintnone\", \"hintslight\", \"hintmedium\", "
"or \"hintfull\"."
msgstr "使用什么程度的微调。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:14
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:14
msgid ""
"Type of subpixel antialiasing; \"none\", \"rgb\", \"bgr\", \"vrgb\", \"vbgr"
"\"."
msgstr "抗锯齿次像素顺序。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:15
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:15
msgid ""
"Resolution for Xft, in 1024 * dots/inch. -1 to use default value. Do not "
"modify it manually."
msgstr "字体分辨率,请不要手动修改。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:16
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:16
msgid "Name of the cursor theme."
msgstr "光标主题。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:17
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:17
msgid "Size of the cursor referenced by cursor_theme."
msgstr "光标大小。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:18
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:18
msgid "Name of default font to use."
msgstr "GTK默认字体。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:19
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:19
msgid "Name of key theme RC file to load."
msgstr "GTK要加载的关键主题的名称。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:20
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:20
msgid ""
"Whether default toolbars have text only, text and icons, icons only, etc."
msgstr "默认工具栏是否只有文本、文本和图标、图标。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:21
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:21
msgid "Size of icons in default toolbars."
msgstr "默认工具栏中图标的大小。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:22
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:22
msgid "How to draw the input method preedit string."
msgstr "如何绘制输入法预编辑字符串。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:23
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:23
msgid "How to draw the input method statusbar."
msgstr "如何绘制输入法状态栏。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:24
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:24
msgid "Name of the input method module used by GTK+."
msgstr "GTK使用的输入法模块的名称。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:25
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:25
msgid "Whether images should be shown in menus."
msgstr "是否应在菜单中显示图像。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:26
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:26
msgid "Whether stock icons should be shown in buttons."
msgstr "图像是否显示在按钮中。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:27
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:27
msgid "The accelerator for moving the focus to the menubar."
msgstr "将焦点移动到菜单栏的加速器"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:28
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:28
msgid ""
"A '\\n' separated list of \"name:color\" as defined by the 'gtk-color-"
"scheme' setting"
msgstr "颜色主题"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:29
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:29
msgid ""
"Module to use as the filesystem model for the GtkFileChooser widget. "
"Possible values are \"gio\" and \"gtk+\"."
msgstr "用作GtkFileChooser小部件的文件系统模型的模块"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:30
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:30
msgid ""
"This setting determines which buttons should be put in the titlebar of "
"client-side decorated windows, and whether they should be placed at the left "
@@ -247,48 +252,48 @@ msgid ""
msgstr ""
"此设置确定哪些按钮应放在客户端装饰窗口的标题栏中,以及是否应放在右侧的左侧。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:31
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:31
msgid ""
"This setting determines where application menu will be displayed - in a "
"window or on a panel with MenuModel protocol."
msgstr ""
"此设置确定应用程序菜单的显示位置在窗口中或使用MenuModel协议的面板上。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:32
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:32
msgid ""
"This setting determines where window menubars will be displayed - in a "
"window or on a panel with MenuModel protocol."
msgstr "此设置确定窗口菜单栏的显示位置在窗口中或使用MenuModel协议的面板上"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:33
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:33
msgid ""
"Whether the context menus of entries and text views should offer to change "
"the input method."
msgstr "条目和文本视图的上下文菜单是否应提供更改输入法的功能。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:34
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:34
msgid ""
"Whether the context menus of entries and text views should offer to insert "
"control characters."
msgstr "条目和文本视图的上下文菜单是否应提供更改输入法的功能。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:35
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:35
msgid ""
"Whether mnemonics should be automatically shown and hidden when the user "
"presses the Alt key."
msgstr "当用户按Alt键时助记符是否应自动显示和隐藏。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:36
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:36
msgid ""
"If true, gtk+ uses the primary paste selection, usually triggered by a "
"middle mouse button click."
msgstr "如果为truegtk+将使用主粘贴选择,通常由鼠标中键单击触发。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:37
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:37
msgid "Whether to enable toolkit-wide animations."
msgstr "是否启用工具箱范围的动画。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:38
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:38
msgid ""
"Whether builtin GTK+ dialogs such as the file chooser, the color chooser or "
"the font chooser will use a header bar at the top to show action widgets, or "
@@ -297,13 +302,13 @@ msgstr ""
"无论是内置的GTK+对话框、文件选择器、颜色选择器或字体选择器,都将使用顶部的标"
"题栏或者底部的操作区域来显示操作小部件。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:39
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:39
msgid ""
"This controls the GTK scale factor that maps from window coordinates to the "
"actual device pixels."
msgstr "控制从窗口坐标映射到实际设备像素的GTK比例因子。"
-#: ../data/com.kylinsec.kiran.xsettings.gschema.xml.in.h:40
+#: ../data/schemas/com.kylinsec.kiran.xsettings.gschema.xml.in.h:40
msgid ""
"This setting determines whether MATE controls the scale factor for QT "
"applications."
@@ -836,6 +841,11 @@ msgstr "({0}错误码0x{1:x})"
msgid "%b %d %Y"
msgstr "%Y年%m月%d日"
+#: ../plugins/display/display-manager.cpp:195
+msgid ""
+"The scaling rate can only take effect after logging out and logging in again"
+msgstr "缩放率需要注销后重新登录才能生效"
+
#: ../plugins/keybinding/custom-shortcut.h:25
msgid "Custom"
msgstr "自定义"
--
2.33.0

View File

@ -1,40 +0,0 @@
From d4f3b5a66d99f9ec4a9aba8af5e07b6d1eeb49e3 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 25 Aug 2022 19:19:24 +0800
Subject: [PATCH 1/3] feature(sonarqube): turn off sonarqube check to
get_error_desc function.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 关闭sonarqube对get_error_desc函数检查
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
lib/base/error.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/base/error.cpp b/lib/base/error.cpp
index 5a95605..0dcbcee 100644
--- a/lib/base/error.cpp
+++ b/lib/base/error.cpp
@@ -23,6 +23,8 @@ CCError::CCError()
{
}
+// sonarqube off
+
std::string CCError::get_error_desc(CCErrorCode error_code, bool attach_error_code)
{
std::string error_desc;
@@ -427,4 +429,7 @@ std::string CCError::get_error_desc(CCErrorCode error_code, bool attach_error_co
}
return error_desc;
}
+
+// sonarqube on
+
} // namespace Kiran
--
2.33.0

View File

@ -1,52 +0,0 @@
From 2425d2e730d1decba801c381521178465da385ac Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Fri, 23 Sep 2022 17:05:12 +0800
Subject: [PATCH] fix(compile): Fix the probability compile error problem
caused by multiple targets depending on output files of add_custom_command.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复由于多个target依赖了add_custom_command的输出引起的概率性的编译报错问题
Closes #I5NP6A
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
src/CMakeLists.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f972713..335b677 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,6 +8,8 @@ file(GLOB_RECURSE CORE_CPP_FILES ./*.cpp)
gen_dbus_stub(CC_DAEMON cc_daemon com.kylinsec.
${CMAKE_SOURCE_DIR}/src/com.kylinsec.Kiran.CCDaemon.xml)
+add_custom_target(TARGET_CC_DAEMON DEPENDS ${CC_DAEMON_GENERATED_STUB})
+
configure_file(config.h.in ${PROJECT_BINARY_DIR}/config.h)
if(build-system-daemon)
@@ -28,6 +30,8 @@ if(build-system-daemon)
target_link_libraries(${TARGET_SYSTEM_DAEMON}
PRIVATE ${GMODULE_LIBRARIES} lib-base lib-dbus lib-iso)
+ add_dependencies(${TARGET_SYSTEM_DAEMON} TARGET_CC_DAEMON)
+
install(TARGETS ${TARGET_SYSTEM_DAEMON}
DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
@@ -60,6 +64,8 @@ if(build-session-daemon)
lib-iso
lib-display)
+ add_dependencies(${TARGET_SESSION_DAEMON} TARGET_CC_DAEMON)
+
install(TARGETS ${TARGET_SESSION_DAEMON}
DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
--
2.33.0

View File

@ -1,41 +0,0 @@
From 9b8ccb8e7e8f1d45315b984ecdbf0ab19870b3dd Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Tue, 9 Aug 2022 10:45:00 +0800
Subject: [PATCH] fix(coredump): Fix coredump problem caused by nullpointer to
SPwd
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复由于访问SPwd空指针引起的崩溃问题。
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
plugins/accounts/accounts-wrapper.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/plugins/accounts/accounts-wrapper.cpp b/plugins/accounts/accounts-wrapper.cpp
index 2cbee6c..4f313f6 100644
--- a/plugins/accounts/accounts-wrapper.cpp
+++ b/plugins/accounts/accounts-wrapper.cpp
@@ -42,13 +42,14 @@ std::vector<PasswdShadow> AccountsWrapper::get_passwds_shadows()
for (auto iter = this->passwds_.begin(); iter != this->passwds_.end(); ++iter)
{
auto spwd = this->spwds_.find(iter->first);
- if (spwd == this->spwds_.end())
+ // 如果spwd不存在可能是因为账户正在创建中这个时候不作为返回值避免出现处理空指针引起的崩溃问题
+ if (spwd != this->spwds_.end())
{
- passwds_shadows.push_back(std::make_pair(iter->second, nullptr));
+ passwds_shadows.push_back(std::make_pair(iter->second, spwd->second));
}
else
{
- passwds_shadows.push_back(std::make_pair(iter->second, spwd->second));
+ KLOG_DEBUG("The shadow info isn't found.");
}
}
--
2.33.0

View File

@ -1,37 +0,0 @@
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,42 +0,0 @@
From 45d7ab7118b99033aca71700c2f5dbded695c53d Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Mon, 15 Aug 2022 14:58:13 +0800
Subject: [PATCH] fix(hidpi): Fixed QT font DPI to avoid double scaling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 设置缩放两倍时通过QT_FONT_DPI固定QT字体DPI避免QT_SCALE_FACTOR和Xft.dpi对字体进行两次缩放过大的问题
Closes #I5LQSK #I5LQQQ
---
plugins/xsettings/xsettings-manager.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/plugins/xsettings/xsettings-manager.cpp b/plugins/xsettings/xsettings-manager.cpp
index 9612a85..7532668 100644
--- a/plugins/xsettings/xsettings-manager.cpp
+++ b/plugins/xsettings/xsettings-manager.cpp
@@ -346,10 +346,19 @@ void XSettingsManager::scale_change_workarounds(int32_t scale)
KLOG_WARNING("There was a problem when setting QT_AUTO_SCREEN_SCALE_FACTOR=0: %s", error.c_str());
}
+
+ /* FIXME: 由于QT_SCALE_FACTOR将会放大窗口以及pt大小字体而缩放将会更改Xft.dpi属性该属性也会导致qt pt字体大小放大字体将会放大过多。
+ 目前暂时解决方案缩放两倍时固定Qt字体DPI 96由QT_SCALE_FACTOR环境变量对窗口以及字体进行放大.
+ 后续应弃用QT_SCALE_FACTOR方案
+ */
if (!XSettingsUtils::update_user_env_variable("QT_SCALE_FACTOR", scale == 2 ? "2" : "1", error))
{
KLOG_WARNING("There was a problem when setting QT_SCALE_FACTOR=%d: %s", scale, error.c_str());
}
+ else if ( scale==2 && !XSettingsUtils::update_user_env_variable("QT_FONT_DPI","96",error) )
+ {
+ KLOG_WARNING("There was a problem when setting QT_FONT_DPI=96: %s", error.c_str());
+ }
}
}
else
--
2.33.0

View File

@ -1,629 +0,0 @@
From ff582cbf24c9727716ca9a1af6a9866a5e0840f6 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 1 Sep 2022 17:41:40 +0800
Subject: [PATCH 2/3] feature(error): Add error message when Failed to apply
display setting.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 当应用显示设置失败时添加错误提示。
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
lib/base/error.cpp | 4 +-
plugins/display/display-manager.cpp | 14 +-
po/zh_CN.po | 217 ++++++++++++++--------------
3 files changed, 127 insertions(+), 108 deletions(-)
diff --git a/lib/base/error.cpp b/lib/base/error.cpp
index 0dcbcee..656e732 100644
--- a/lib/base/error.cpp
+++ b/lib/base/error.cpp
@@ -219,6 +219,9 @@ std::string CCError::get_error_desc(CCErrorCode error_code, bool attach_error_co
case CCErrorCode::ERROR_DISPLAY_UNKNOWN_REFLECT_TYPE:
error_desc = _("Unknown reflect type.");
break;
+ case CCErrorCode::ERROR_DISPLAY_EXEC_XRANDR_FAILED:
+ error_desc = _("The current settings cannot be applied.");
+ break;
case CCErrorCode::ERROR_APPEARANCE_THEME_NOT_EXIST:
error_desc = _("Theme not exist.");
break;
@@ -387,7 +390,6 @@ std::string CCError::get_error_desc(CCErrorCode error_code, bool attach_error_co
case CCErrorCode::ERROR_ACCOUNTS_USER_GROUP_NOT_FOUND:
case CCErrorCode::ERROR_ACCOUNTS_USER_AUTH_SAVE_DATA_FAILED:
case CCErrorCode::ERROR_ACCOUNTS_USER_AUTH_DEL_DATA_FAILED:
- case CCErrorCode::ERROR_DISPLAY_EXEC_XRANDR_FAILED:
case CCErrorCode::ERROR_DISPLAY_SAVE_CREATE_FILE_FAILED:
case CCErrorCode::ERROR_DISPLAY_WRITE_CONF_FILE_FAILED:
case CCErrorCode::ERROR_APPEARANCE_SET_BACKGROUND_FAILED:
diff --git a/plugins/display/display-manager.cpp b/plugins/display/display-manager.cpp
index bc18eb9..9b7190e 100644
--- a/plugins/display/display-manager.cpp
+++ b/plugins/display/display-manager.cpp
@@ -580,13 +580,23 @@ bool DisplayManager::apply(CCErrorCode &error_code)
try
{
+ std::string standard_error;
+ int32_t exit_status = 0;
+
KLOG_DEBUG("cmdline: %s.", cmdline.c_str());
- Glib::spawn_command_line_sync(cmdline);
+ Glib::spawn_command_line_sync(cmdline, nullptr, &standard_error, &exit_status);
+
+ if (!standard_error.empty() || exit_status != 0)
+ {
+ error_code = CCErrorCode::ERROR_DISPLAY_EXEC_XRANDR_FAILED;
+ KLOG_WARNING("Failed to run xrandr: %s.", standard_error.c_str());
+ return false;
+ }
}
catch (const Glib::Error &e)
{
error_code = CCErrorCode::ERROR_DISPLAY_EXEC_XRANDR_FAILED;
- KLOG_WARNING("%s.", e.what().c_str());
+ KLOG_WARNING("Failed to run xrandr: %s.", e.what().c_str());
return false;
}
return true;
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 0f3f202..e1c431e 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kiran-cc-daemon 2.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2022-08-16 17:47+0800\n"
+"POT-Creation-Date: 2022-09-01 17:39+0800\n"
"PO-Revision-Date: 2020-07-01 17:54+0800\n"
"Last-Translator: tangjie02 <tangjie02@kylinos.com.cn>\n"
"Language-Team: Chinese (simplified)\n"
@@ -406,424 +406,428 @@ msgstr "输出版本信息并退出"
msgid "Control center"
msgstr "控制中心"
-#: ../lib/base/error.cpp:32
+#: ../lib/base/error.cpp:34
msgid "The argument is invalid."
msgstr "参数不合法。"
-#: ../lib/base/error.cpp:35
+#: ../lib/base/error.cpp:37
msgid "Operation failed."
msgstr "操作失败。"
-#: ../lib/base/error.cpp:39
+#: ../lib/base/error.cpp:41
msgid "The plugin doesn't exist."
msgstr "插件不存在。"
-#: ../lib/base/error.cpp:46
+#: ../lib/base/error.cpp:48
msgid "No user found."
msgstr "没有发现用户。"
-#: ../lib/base/error.cpp:49
+#: ../lib/base/error.cpp:51
msgid "Multiple users have the same authentication data."
msgstr "多个用户存在相同的认证数据"
-#: ../lib/base/error.cpp:52
+#: ../lib/base/error.cpp:54
msgid ""
"The user is already logined in, Please log off the user before deleting it."
msgstr "用户已经登录,请注销该用户后再删除"
-#: ../lib/base/error.cpp:55
+#: ../lib/base/error.cpp:57
msgid "The user already exists."
msgstr "用户已存在。"
-#: ../lib/base/error.cpp:58
+#: ../lib/base/error.cpp:60
msgid "Unknown account type."
msgstr "未知的用户类型。"
-#: ../lib/base/error.cpp:61
+#: ../lib/base/error.cpp:63
msgid "Can't update password file."
msgstr "不能更新password文件。"
-#: ../lib/base/error.cpp:64
+#: ../lib/base/error.cpp:66
msgid "Invalid command syntax."
msgstr "命令语法无效。"
-#: ../lib/base/error.cpp:67
+#: ../lib/base/error.cpp:69
msgid "Invalid argument to option."
msgstr "命令参数无效。"
-#: ../lib/base/error.cpp:70
+#: ../lib/base/error.cpp:72
msgid "UID already in use."
msgstr "UID已在使用中。"
-#: ../lib/base/error.cpp:73
+#: ../lib/base/error.cpp:75
msgid "Passwd file contains errors."
msgstr "Passwd文件存在错误。"
-#: ../lib/base/error.cpp:76
+#: ../lib/base/error.cpp:78
msgid "Specified user/group doesn't exist."
msgstr "指定的用户/组不存在。"
-#: ../lib/base/error.cpp:79
+#: ../lib/base/error.cpp:81
msgid "User to modify is logged in."
msgstr "要修改的用户已登陆。"
-#: ../lib/base/error.cpp:82
+#: ../lib/base/error.cpp:84
msgid "Username already in use."
msgstr "用户名已经在使用中。"
-#: ../lib/base/error.cpp:85
+#: ../lib/base/error.cpp:87
msgid "Can't update group file."
msgstr "不能更新group文件。"
-#: ../lib/base/error.cpp:88
+#: ../lib/base/error.cpp:90
msgid "Insufficient space to move home dir."
msgstr "空间不足,无法移动主目录。"
-#: ../lib/base/error.cpp:91
+#: ../lib/base/error.cpp:93
msgid "Can't create/remove/move home directory."
msgstr "不能创建/删除/移动主目录。"
-#: ../lib/base/error.cpp:95
+#: ../lib/base/error.cpp:97
msgid "Can't update SELinux user mapping."
msgstr "无法更新SELinux用户映射。"
-#: ../lib/base/error.cpp:98
+#: ../lib/base/error.cpp:100
msgid "Can't update the subordinate uid file."
msgstr "无法更新下级uid文件。"
-#: ../lib/base/error.cpp:101
+#: ../lib/base/error.cpp:103
msgid "Can't update the subordinate gid file."
msgstr "无法更新下级gid文件。"
-#: ../lib/base/error.cpp:104
+#: ../lib/base/error.cpp:106
msgid "Refuse to delete root user."
msgstr "禁止删除root用户。"
-#: ../lib/base/error.cpp:107
+#: ../lib/base/error.cpp:109
msgid "Refuse to delete three authority user."
msgstr "禁止删除三权用户。"
-#: ../lib/base/error.cpp:113
+#: ../lib/base/error.cpp:115
msgid "The authentication mode isn't supported."
msgstr "认证模式不支持。"
-#: ../lib/base/error.cpp:116
+#: ../lib/base/error.cpp:118
msgid "User is locked."
msgstr "用户被锁定。"
-#: ../lib/base/error.cpp:119
+#: ../lib/base/error.cpp:121
msgid "The name already exists."
msgstr "名字已存在"
-#: ../lib/base/error.cpp:123
+#: ../lib/base/error.cpp:125
msgid "The range of volume is between 0 and 1.0."
msgstr "音量范围必须在[0, 1.0]之间"
-#: ../lib/base/error.cpp:127
+#: ../lib/base/error.cpp:129
msgid "The range of balance is between -1 and 1."
msgstr "平衡范围必须在[-1, 1]之间"
-#: ../lib/base/error.cpp:131
+#: ../lib/base/error.cpp:133
msgid "The sink device isn't found."
msgstr "未找到输出设备。"
-#: ../lib/base/error.cpp:135
+#: ../lib/base/error.cpp:137
msgid "The source device isn't found."
msgstr "未找到输入设备。"
-#: ../lib/base/error.cpp:139
+#: ../lib/base/error.cpp:141
msgid "The sink stream isn't found."
msgstr "未找到输出流。"
-#: ../lib/base/error.cpp:142
+#: ../lib/base/error.cpp:144
msgid "NTP unit is active."
msgstr "NTP服务已开启。"
-#: ../lib/base/error.cpp:145
+#: ../lib/base/error.cpp:147
msgid "Invalid timezone."
msgstr "不合法的时区。"
-#: ../lib/base/error.cpp:148
+#: ../lib/base/error.cpp:150
msgid "No NTP unit available."
msgstr "没有NTP服务可用。"
-#: ../lib/base/error.cpp:152
+#: ../lib/base/error.cpp:154
msgid "Unknown date format type."
msgstr "未知的日期格式化类型。"
-#: ../lib/base/error.cpp:155
+#: ../lib/base/error.cpp:157
msgid "Failed to set date format."
msgstr "设置日期显示格式失败。"
-#: ../lib/base/error.cpp:158
+#: ../lib/base/error.cpp:160
msgid "Failed to set hour format."
msgstr "设置时间显示格式失败。"
-#: ../lib/base/error.cpp:161
+#: ../lib/base/error.cpp:163
msgid "Failed to set seconds showing."
msgstr "设置秒数是否显示失败。"
-#: ../lib/base/error.cpp:164
+#: ../lib/base/error.cpp:166
msgid "Failed to start NTP unit."
msgstr "开启NTP服务失败。"
-#: ../lib/base/error.cpp:167
+#: ../lib/base/error.cpp:169
msgid "Failed to stop NTP unit."
msgstr "停止NTP服务失败。"
-#: ../lib/base/error.cpp:171
+#: ../lib/base/error.cpp:173
msgid "Unknown display style."
msgstr "未知的显示类型。"
-#: ../lib/base/error.cpp:174
+#: ../lib/base/error.cpp:176
msgid ""
"The mode of monitors which contain resolution and refresh rate is no "
"intersection."
msgstr "所有显示器没有相同的分辨率和刷新率。"
-#: ../lib/base/error.cpp:177
+#: ../lib/base/error.cpp:179
msgid "Auto mode is set failed."
msgstr "自动模式设置失败。"
-#: ../lib/base/error.cpp:181
+#: ../lib/base/error.cpp:183
msgid "Failed to set the window scaling factor."
msgstr "设置窗口缩放因子失败。"
-#: ../lib/base/error.cpp:184
+#: ../lib/base/error.cpp:186
msgid "The custom configuration file isn't found."
msgstr "未找到自定义配置文件。"
-#: ../lib/base/error.cpp:187
+#: ../lib/base/error.cpp:189
msgid "Not found matched item in custom configuration file."
msgstr "不能找到匹配的配置项。"
-#: ../lib/base/error.cpp:190
+#: ../lib/base/error.cpp:192
msgid "The primary monitor must not be empty."
msgstr "主显示器不能为空。"
-#: ../lib/base/error.cpp:193
+#: ../lib/base/error.cpp:195
msgid "Not found the primary monitor."
msgstr "未找到主显示器。"
-#: ../lib/base/error.cpp:196
+#: ../lib/base/error.cpp:198
msgid ""
"Cannot disable the monitor, because the number of the enabled monitor is "
"less than 1."
msgstr "不能禁用显示器因为启用的显示器数量已经少于2个。"
-#: ../lib/base/error.cpp:199
+#: ../lib/base/error.cpp:201
msgid "Exist null mode in mode list."
msgstr "模式列表中存在空的模式。"
-#: ../lib/base/error.cpp:202
+#: ../lib/base/error.cpp:204
msgid "Exist null mode in preferred mode list."
msgstr "在推荐模式中存在空的模式。"
-#: ../lib/base/error.cpp:205
+#: ../lib/base/error.cpp:207
msgid "The current mode is not exist."
msgstr "当前模式不存在。"
-#: ../lib/base/error.cpp:209
+#: ../lib/base/error.cpp:211
msgid "Not found match mode."
msgstr "未发现匹配的模式。"
-#: ../lib/base/error.cpp:212
+#: ../lib/base/error.cpp:214
msgid "The mode is not exist."
msgstr "当前模式不存在。"
-#: ../lib/base/error.cpp:215
+#: ../lib/base/error.cpp:217
msgid "Unknown rotation type."
msgstr "未知的旋转类型。"
-#: ../lib/base/error.cpp:218
+#: ../lib/base/error.cpp:220
msgid "Unknown reflect type."
msgstr "未知的映射类型。"
-#: ../lib/base/error.cpp:221
+#: ../lib/base/error.cpp:223
+msgid "The current settings cannot be applied."
+msgstr "无法应用当前设置。"
+
+#: ../lib/base/error.cpp:226
msgid "Theme not exist."
msgstr "主题不存在。"
-#: ../lib/base/error.cpp:224
+#: ../lib/base/error.cpp:229
msgid "Unsupported theme type."
msgstr "主题类型不支持。"
-#: ../lib/base/error.cpp:227
+#: ../lib/base/error.cpp:232
msgid "Invalid theme type."
msgstr "主题类型不合法。"
-#: ../lib/base/error.cpp:231
+#: ../lib/base/error.cpp:236
msgid "Invalid font type."
msgstr "字体类型不合法。"
-#: ../lib/base/error.cpp:234
+#: ../lib/base/error.cpp:239
msgid "Unsupported font type."
msgstr "字体类型不支持。"
-#: ../lib/base/error.cpp:237
+#: ../lib/base/error.cpp:242
msgid "An incomplete request already exists."
msgstr "存在未完成的请求。"
-#: ../lib/base/error.cpp:240
+#: ../lib/base/error.cpp:245
msgid "The request is canceled."
msgstr "请求被取消。"
-#: ../lib/base/error.cpp:246
+#: ../lib/base/error.cpp:251
msgid "The request is rejected."
msgstr "请求被拒绝。"
-#: ../lib/base/error.cpp:249
+#: ../lib/base/error.cpp:254
msgid "Not found adapter."
msgstr "未发现适配器。"
-#: ../lib/base/error.cpp:257
+#: ../lib/base/error.cpp:262
msgid "Sync to file failed."
msgstr "同步到文件失败。"
-#: ../lib/base/error.cpp:263
+#: ../lib/base/error.cpp:268
msgid "Invalid scale mode."
msgstr "缩放模式不合法。"
-#: ../lib/base/error.cpp:266
+#: ../lib/base/error.cpp:271
msgid "The number of the layout can't exceeds {0}."
msgstr "布局数量不能超过{0}个。"
-#: ../lib/base/error.cpp:269
+#: ../lib/base/error.cpp:274
msgid "The layout is invalid."
msgstr "该布局不合法。"
-#: ../lib/base/error.cpp:272
+#: ../lib/base/error.cpp:277
msgid "The layout already exist."
msgstr "该布局已存在。"
-#: ../lib/base/error.cpp:275
+#: ../lib/base/error.cpp:280
msgid "Failed to set the layout."
msgstr "设置布局失败。"
-#: ../lib/base/error.cpp:278
+#: ../lib/base/error.cpp:283
msgid "The layout is no exist."
msgstr "该布局不存在。"
-#: ../lib/base/error.cpp:281
+#: ../lib/base/error.cpp:286
msgid "Failed to update the layout."
msgstr "更新布局失败。"
-#: ../lib/base/error.cpp:284
+#: ../lib/base/error.cpp:289
msgid "The layout option already exist."
msgstr "布局选项已存在。"
-#: ../lib/base/error.cpp:287
+#: ../lib/base/error.cpp:292
msgid "Failed to set the layout option."
msgstr "设置布局选项失败。"
-#: ../lib/base/error.cpp:290
+#: ../lib/base/error.cpp:295
msgid "The layout option is no exist."
msgstr "布局选项不存在。"
-#: ../lib/base/error.cpp:293
+#: ../lib/base/error.cpp:298
msgid "Failed to update the layout option."
msgstr "更新布局选项失败。"
-#: ../lib/base/error.cpp:296
+#: ../lib/base/error.cpp:301
msgid "Failed to clear the layout option."
msgstr "清理布局选项失败。"
-#: ../lib/base/error.cpp:299
+#: ../lib/base/error.cpp:304
msgid "The custom shortcut isn't exist."
msgstr "自定义快捷键不存在。"
-#: ../lib/base/error.cpp:303
+#: ../lib/base/error.cpp:308
msgid "The key combination already exist."
msgstr "按键组合已经存在。"
-#: ../lib/base/error.cpp:307
+#: ../lib/base/error.cpp:312
msgid "The key combination is invalid."
msgstr "按键组合不合法。"
-#: ../lib/base/error.cpp:310
+#: ../lib/base/error.cpp:315
msgid "The system shortcut isn't exist."
msgstr "该系统快捷键不存在。"
-#: ../lib/base/error.cpp:316
+#: ../lib/base/error.cpp:321
msgid "Unsupported power supply mode."
msgstr "不支持该供电模式。"
-#: ../lib/base/error.cpp:322
+#: ../lib/base/error.cpp:327
msgid "Unsupported power device."
msgstr "不支持该设备。"
-#: ../lib/base/error.cpp:325
+#: ../lib/base/error.cpp:330
msgid "The value must be between 0 and 100."
msgstr "值必须在0到100之间"
-#: ../lib/base/error.cpp:329
+#: ../lib/base/error.cpp:334
msgid "Unknown power action."
msgstr "未知电源动作。"
-#: ../lib/base/error.cpp:333
+#: ../lib/base/error.cpp:338
msgid "Unsupported power event."
msgstr "事件不支持。"
-#: ../lib/base/error.cpp:336
+#: ../lib/base/error.cpp:341
msgid "Failed to set the action."
msgstr "设置触发行为失败。"
-#: ../lib/base/error.cpp:339
+#: ../lib/base/error.cpp:344
msgid "Failed to set brightness."
msgstr "设置亮度失败。"
-#: ../lib/base/error.cpp:342
+#: ../lib/base/error.cpp:347
msgid "The systeminfo type is invalid."
msgstr "系统信息类型不合法。"
-#: ../lib/base/error.cpp:345
+#: ../lib/base/error.cpp:350
msgid "Failed to set host name."
msgstr "设置主机名失败。"
-#: ../lib/base/error.cpp:348
+#: ../lib/base/error.cpp:353
msgid "Not found the property."
msgstr "未找到该属性。"
-#: ../lib/base/error.cpp:351
+#: ../lib/base/error.cpp:356
msgid "The type is mismatch."
msgstr "类型不匹配。"
-#: ../lib/base/error.cpp:354
+#: ../lib/base/error.cpp:359
msgid "The property is invalid."
msgstr "属性不合法"
-#: ../lib/base/error.cpp:357
+#: ../lib/base/error.cpp:362
msgid "The property must not be modified manually."
msgstr "属性不能手动修改。"
-#: ../lib/base/error.cpp:360
+#: ../lib/base/error.cpp:365
msgid "The property is unsupported."
msgstr "属性不支持。"
-#: ../lib/base/error.cpp:364
+#: ../lib/base/error.cpp:369
msgid "Arguments invalid."
msgstr "参数不合法"
-#: ../lib/base/error.cpp:367
+#: ../lib/base/error.cpp:372
msgid "The network proxy mode is invalid."
msgstr "代理模式不合法"
-#: ../lib/base/error.cpp:370
+#: ../lib/base/error.cpp:375
msgid "The current network proxy mode is not manual."
msgstr "当前代理模式不是手动模式。"
-#: ../lib/base/error.cpp:373
+#: ../lib/base/error.cpp:378
msgid "The current network proxy mode is not auto."
msgstr "当前代理模式不是自动模式。"
-#: ../lib/base/error.cpp:414
+#: ../lib/base/error.cpp:418
msgid "Internel error."
msgstr "内部错误。"
-#: ../lib/base/error.cpp:417 ../lib/base/error.cpp:420
+#: ../lib/base/error.cpp:421 ../lib/base/error.cpp:424
msgid "Unknown error."
msgstr "未知错误。"
-#: ../lib/base/error.cpp:426 ../plugins/accounts/accounts-util.cpp:209
+#: ../lib/base/error.cpp:430 ../plugins/accounts/accounts-util.cpp:209
msgid " (error code: 0x{:x})"
msgstr "(错误码0x{:x})"
@@ -1194,6 +1198,9 @@ msgstr "电源管理"
msgid "Power management daemon"
msgstr "电源管理后端"
+#~ msgid "Display setting failed."
+#~ msgstr "显示设置失败。"
+
#~ msgid "The custom shortcut is invalid."
#~ msgstr "自定义快捷键不合法。"
--
2.33.0

View File

@ -1,83 +0,0 @@
From e4485a62f8f8f6bb0695d6a1510b05e774409144 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Mon, 5 Sep 2022 11:52:45 +0800
Subject: [PATCH 3/3] fix(display): Fixed the display configuration
application failure caused by output name matching failure
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复由于output name匹配失败导致显示配置应用失败问题
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
include/error-i.h | 1 +
lib/base/error.cpp | 1 +
plugins/display/display-manager.cpp | 16 ++++++++++------
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/include/error-i.h b/include/error-i.h
index c67b604..61aebac 100644
--- a/include/error-i.h
+++ b/include/error-i.h
@@ -159,6 +159,7 @@ extern "C"
ERROR_DISPLAY_NOTFOUND_MODE_BY_ID,
ERROR_DISPLAY_UNKNOWN_ROTATION_TYPE,
ERROR_DISPLAY_UNKNOWN_REFLECT_TYPE,
+ ERROR_DISPLAY_NO_ENABLED_MONITOR,
// Greeter
ERROR_GREETER_SYNC_TO_FILE_FAILED_1 = 0x190000,
diff --git a/lib/base/error.cpp b/lib/base/error.cpp
index 656e732..874277c 100644
--- a/lib/base/error.cpp
+++ b/lib/base/error.cpp
@@ -392,6 +392,7 @@ std::string CCError::get_error_desc(CCErrorCode error_code, bool attach_error_co
case CCErrorCode::ERROR_ACCOUNTS_USER_AUTH_DEL_DATA_FAILED:
case CCErrorCode::ERROR_DISPLAY_SAVE_CREATE_FILE_FAILED:
case CCErrorCode::ERROR_DISPLAY_WRITE_CONF_FILE_FAILED:
+ case CCErrorCode::ERROR_DISPLAY_NO_ENABLED_MONITOR:
case CCErrorCode::ERROR_APPEARANCE_SET_BACKGROUND_FAILED:
case CCErrorCode::ERROR_APPEARANCE_SET_LOCKSCREEN_BACKGROUND_FAILED:
case CCErrorCode::ERROR_SYSTEMINFO_JSON_ASSIGN_FAILED:
diff --git a/plugins/display/display-manager.cpp b/plugins/display/display-manager.cpp
index 9b7190e..778a81b 100644
--- a/plugins/display/display-manager.cpp
+++ b/plugins/display/display-manager.cpp
@@ -415,15 +415,17 @@ bool DisplayManager::apply_screen_config(const ScreenConfigInfo &screen_config,
if (!monitor)
{
KLOG_WARNING("cannot find monitor for %s.", uid.c_str());
- continue;
+ return false;
}
+ /* 一般情况下uid相同时name也是相同的但是有些特殊情况会出现不一样这里uid主要是为了唯一标识一台显示器
+ 而name是用来区分显示器接口的比如有一台显示器最开始是接入在HDMI-1后面改到HDMI-2了那么在能获取到edid的
+ 情况下uid是不变的但是name会发生变化。如果出现name不一样的情况下这里仅仅记录日志方便后续跟踪问题。*/
if (c_monitor.name() != monitor->name_get())
{
- KLOG_WARNING("the name is mismatch. config name: %s, monitor name: %s.",
- c_monitor.name().c_str(),
- monitor->name_get().c_str());
- continue;
+ KLOG_DEBUG("The monitor name is dismatch. config name: %s, monitor name: %s.",
+ c_monitor.name().c_str(),
+ monitor->name_get().c_str());
}
auto mode = monitor->match_best_mode(c_monitor.width(), c_monitor.height(), c_monitor.refresh_rate());
@@ -502,7 +504,9 @@ bool DisplayManager::save_config(CCErrorCode &error_code)
// 禁止保存没有开启任何显示器的配置,这可能会导致下次进入会话屏幕无法显示
if (this->get_enabled_monitors().size() == 0)
{
- error_code = CCErrorCode::ERROR_DISPLAY_ONLY_ONE_ENABLED_MONITOR;
+ KLOG_WARNING("It is forbidden to save the configuration without any display turned on, "
+ "which may cause the next session screen not to be displayed.");
+ error_code = CCErrorCode::ERROR_DISPLAY_NO_ENABLED_MONITOR;
return false;
}
--
2.33.0

Binary file not shown.

Binary file not shown.

View File

@ -1,20 +1,11 @@
Name: kiran-cc-daemon
Version: 2.3.1
Release: 7
Version: 2.4.0
Release: 1
Summary: DBus daemon for Kiran Desktop
License: MulanPSL-2.0
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
Patch0005: 0001-feature-sonarqube-turn-off-sonarqube-check-to-get_er.patch
Patch0006: 0002-feature-error-Add-error-message-when-Failed-to-apply.patch
Patch0007: 0003-fix-display-Fixed-the-display-configuration-applicat.patch
Patch0008: 0001-fix-compile-Fix-the-probability-compile-error-proble.patch
BuildRequires: cmake >= 3.2
BuildRequires: pkgconfig(glibmm-2.4)
@ -41,6 +32,9 @@ BuildRequires: gdbus-codegen-glibmm
BuildRequires: gtest-devel
BuildRequires: libnotify-devel
BuildRequires: pulseaudio-libs-devel
BuildRequires: libgtop2-devel
BuildRequires: libgudev-devel
BuildRequires: cryptopp-devel
%description
@ -55,6 +49,11 @@ Requires: polkit
Requires: kiran-cc-daemon-common
Requires: util-linux
Requires: pciutils
Requires: libgtop2
Requires: libgudev
Requires: lshw
Requires: passwd
%if 0%{?openEuler}
Requires: openeuler-lsb
@ -146,236 +145,11 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || :
%dir %{_includedir}/kiran-cc-daemon
%dir %{_includedir}/kiran-cc-daemon/kiran-system-daemon
%dir %{_includedir}/kiran-cc-daemon/kiran-session-daemon
%{_includedir}/kiran-cc-daemon/kiran-system-daemon/*_i.h
%{_includedir}/kiran-cc-daemon/kiran-system-daemon/*-i.h
%{_includedir}/kiran-cc-daemon/kiran-session-daemon/*_i.h
%{_includedir}/kiran-cc-daemon/kiran-session-daemon/*-i.h
%{_libdir}/pkgconfig/kiran-cc-daemon.pc
%changelog
* Fri Sep 23 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-7
- KYOS-B: Fix the probability compile error problem caused by multiple targets depending on output files of add_custom_command.(#I5NP6A)
* Tue Sep 06 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-6
- KYOS-B: Fixed the display configuration application failure caused by output name matching failure
- KYOS-F: Add error message when Failed to apply display setting.
* 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.
* Mon Aug 15 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.1-3
- KYOS-B: Fixed QT font DPI to avoid double scaling(#I5LQSK,#I5LQQQ)
* Tue Aug 09 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-2
- KYOS-B: Fix coredump problem caused by nullpointer to SPwd.
* Thu Jul 28 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-1
- KYOS-B: Fix the problem that system version shows empty content in comunity version. (#I5H4D6)
- KYOS-B: Fix the problem that system and sound classes in keybindings aren't shown.(#I5I6OU)
* Tue Jul 12 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-2
- KYOS-B: Try reconnection if failed to connect pulseaudio service firstly.
- KYOS-F: Fix the coredump as failed to connect pulaseaudio service.
* Fri Jul 08 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.0-1
- KYOS-F: Enable network and audio plugins defaultly.
* Wed Mar 02 2022 longcheng <longcheng@kylinos.com.cn> - 2.2.4-3
- KYOS-F: Do not output the alarm information to the screen
* Thu Feb 24 2022 chendingjian <chendingjian@kylinos.com.cn> - 2.2.4-2
- rebuild for KY3.4-MATE-modules-dev
* Tue Feb 22 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.4-1.kb2
- KYOS-F: Fix the com.kylinsec.Kiran.SessionDaemon.Power.policy file generation error caused by the logic error of CMakeLists.
* Sat Feb 19 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.4-1.kb1
- KYOS-F: Fix compile error on KLOG_PROFILE.
* Fri Feb 18 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.3-2.kb6
- KYOS-B: Fix the function invalid problem when set the action of power button pressed.(#50020)
- KYOS-B: Show remaining electrictiy in power tray icon.(#48516)
* Thu Feb 17 2022 longcheng <longcheng@kylinsec.com.cn> - 2.2.3-2.kb5
- KYOS-B: Change the Requires mate-session-manager to kiran-session-manager for kiran-session-daemon (#49934)
* Wed Feb 16 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.3-2.kb4
- KYOS-F: Register client to session manager after the plugins is inited.
- KYOS-F: Modify the default gtk theme to kiran-dark.
* Wed Jan 19 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.3-2.kb3
- KYOS-B: Fix the disappear problem for power tray icon on laptop.(#48516)
* Tue Jan 18 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.3-2.kb2
- KYOS-F: Add audio-i.h header file to install directory.
- KYOS-B: Add reset dbus api for keybinding.(#48466)
- KYOS-B: Set cursor theme name to org.mate.peripherals-mouse.cursor-them for making marco to update cursor them.(#48458)
- KYOS-F: Append the configure_file command to generate com.kylinsec.Kiran.SessionDaemon.Power.policy file.
- KYOS-B: Forbit deleting logined user.(#49244)
- KYOS-F: Modify the log output level in DeleteUser when exception is throwed.
* Wed Dec 29 2021 kpkg <kpkg@kylinos.com.cn> - 2.2.3-2.kb1
- rebuild for KY3.4-MATE-modules-dev
* Wed Dec 29 2021 caoyuanji<caoyuanji@kylinos.com.cn> - 2.2.3-2
- Upgrade version number for easy upgrade
* Mon Dec 20 2021 caoyuanji <caoyuanji@kylinos.com.cn> - 2.2.3-1.kb1
- rebuild for KY3.4-4-KiranUI-2.2
* Wed Dec 15 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.3-1.ky3
- KYOS-F: Add more additional error information for accounts plugins
- KYOS-F: Doesn't reboot caja, kiran-panel and marco when the window scale is inited firstly.
* Tue Dec 07 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.2-1.ky3
- KYOS-F: Modify the default switch value of plugins.
- KYOS-B: Ignore the 'disabled' keycomb when look shotcut by keycomb.
- KYOS-B: The color of power status icon is changed with gtk theme.
* Mon Nov 22 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1-4.ky3
- KYOS-B: Delete translation file in kiran-session-daemon.
* Mon Nov 22 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1-3.ky3
- KYOS-B: Only allow to load kiran-session-daemon in KIRAN desktop environment.
- KYOS-B: Fix coredump when the program is exited.
* Wed Nov 17 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1-2.ky3
- KYOS-B: Modify libinputdevices-common to static library.
* Mon Nov 15 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.1-1.ky3
- KYOS-B: Stop the conflicted plugins of mate-settings-daemon with kiran-session-daemon when the kiran-session-daemon is started and start the conflicted plugins when the kiran-session-daemon is stopped.
* Fri Nov 05 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.0-1.ky3
- KYOS-B: Enable Display, Keybinding, keyboard, mouse, power, touchpad, xsettigns plugins.
* Fri Sep 10 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.0-3.ky3
- KYOS-B: Fix the compile error in KY3.3-9.
* Thu Sep 09 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.0-2.ky3
- KYOS-F: Rebuild for 2.1.0-1
* Wed Sep 08 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.0-1.ky3
- KYOS-B: Accounts plugin doesn't create cached file default when a user is added. (#43305)
- KYOS-F: Modify the display.xml saved directory.
- KYOS-F: Modify the default value for gtk-font-name in gsettings.
- KYOS-F: Change license to MulanPSL2.
* Mon Aug 09 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.7-1.ky3
- KYOS-F: Add account password expiration policy.
- KYOS-F: Delete upower library dependency.
* Thu Jun 24 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.6-3.ky3
- KYOS-B: Add -f option in userdel command to fix the problem that user cannot be deleted when the user login and then logout.
* Wed Jun 16 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.6-2.ky3
- KYOS-F: Add translation for dbus authoriation failed.
* Wed Jun 09 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.6-1.ky3
- KYOS-F: Add cmake variables for enable/disable plugins.
* Fri Jun 04 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.5-1.ky3
- KYOS-B: Fix the name error in greeter service file.
* Thu May 27 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.4-1.ky3
- KYOS-B: Fix the compile error in KY3.3-6.
- KYOS-F: Rename these header files which suffix is _i.h to xxx-i.h
* Thu May 13 2021 tangjei02 <tangjie02@kylinos.com.cn> 2.0.3-1.ky3
- KYOS-F: The first parameter of function SetAutologinUser is changed to user name instead of user uid.
- KYOS-F: Rename dbus, file, class and variable and provide kiran-greeter.conf.
- KYOS-F: Cache user infomation for root.
* Wed Apr 14 2021 yangxiaoqing <yangxiaoqing@kylinos.com.cn> 2.0.2+alpha2-2.ky3.kb1
- KYOS-C: Set plugin of greeter-settings available.
- KYOS-B: Fix the segment error of GreeterSettingsManager::get_background_file().
* Thu Apr 01 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha2-2.ky3
- Delete third party and replace by pkg_search_module.
* Sat Mar 27 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha2-1.ky3
- KYOS-B: Fix the display errors of disks and eths in ft machine.
* Thu Mar 25 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-2.ky3.kb3
- KYOS-B: Fix the display error of the hardware info in sw machine.
* Tue Mar 23 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-2.ky3.kb2
- KYOS-B: Fix the problem that disk info cannot be displayed in KY3.3-9.
* Mon Mar 22 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-2.ky3.kb1
- KYOS-F: The hostname set by SetHostName function is restored when system reboot.
* Fri Mar 19 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-2.ky3
- KYOS-B: Fix the UnicodeEncodeError when generate source files by gdbus-codegen-glibmm.
* Thu Mar 18 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.2+alpha1-1.ky3
- KYOS-B: Fix the compile error in KY3.3-9.
- KYOS-F: Add authentication manager for fingerprint and face datas.
* Wed Mar 17 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha6-1.ky3.kb2
- KYOS-F: Disable greeter and display plugins.
* Mon Mar 15 2021 yangxiaoqing <yangxiaoqing@kylinos.com.cn> 2.0.1+alpha6-1.ky3.kb1
- KYOS-C: Remove unused dependent library.
- KYOS-P: Modify the file name of dbus xml.
* Thu Mar 04 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha6-1.ky3
- KYOS-F: Add systeminfo and greeter-settings plugins.
- KYOS-F: Add timedate display format settings.
* Mon Feb 01 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha5-2.ky3
- KYOS-F: Replace the logs output function with zlog.
- KYOS-F: Enable account and display setting plugins.
* Mon Dec 07 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha5-1.ky3.kb1
- KYOS-B: Disable account setting plugin.
* Mon Nov 30 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha5-1.ky3
- KYOS-B: Add kiran-session-daemon which contain display setting plugin.
* Tue Nov 17 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha4-3.ky3
- KYOS-B: Fix the return value error when create user failed.
- KYOS-F: Remove -f option when delete user.
- KYOS-B: Modify /usr/bin/usermod to /usr/sbin/usermod
* Tue Nov 03 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha4-2.ky3
- KYOS-F: Update icon path when icon path is not found.
- KYOS-F: Don't need to verify to change self account password.
- KYOS-F: Separate header file to development package.
- KYOS-F: Add translation for dbus return value.
- KYOS-F: Modify unikylin to kylinsec.
* Mon Oct 12 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha4-1.ky3
- KYOS-F: Support to set user uid when create user.
* Tue Sep 29 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alhpa3-3.ky3
- KYOS-F: Move to tag KY3.4-MATE-modules-dev.
* Tue Sep 29 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alhpa3-2.ky3
- KYOS-B: Fix the compile error that cannot find macro ADJ_SETOFFSET in KY3.3-9
- KYOS-F: Add files monitor for /etc/adjtime, /etc/localtime and ntp service path
* Sun Sep 27 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alhpa3-1.ky3.kb2
- KYOS-F: Apply the Patch1001 file.
* Sun Sep 27 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alhpa3-1.ky3.kb1
- KYOS-B: Fix the installing path error.
* Tue Sep 22 2020 tangjie02 <tangjie02@kylinos.com.cn> 2.0.1+alpha3-1.ky3
- KYOS-B: Fix plugins loading error due to KCC_PLUGIN_DIR variable no found.
* Fri Sep 18 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha2-1.ky3
- New upstream source 2.0.1~alpha2
* Thu Sep 17 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha1-3.ky3
- KYOS-F: Fix build error for lack of dependencies
* Thu Sep 17 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha1-2.ky3
- KYOS-F: Enable system daemon in post section
- KYOS-F: Stop system daemon service before uninstall
* Thu Sep 17 2020 songchuanfei <songchuanfei@kylinos.com.cn> 2.0.1~alpha1-1.ky3
- New upstream source
* Tue Oct 25 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.4.0-1
- KYOS-F: init commit for v2.4 version.