update to 2.2.1
Signed-off-by: kylinsecos_admin <gitee@kylinos.com.cn>
This commit is contained in:
parent
33ea52ab79
commit
b6d803a18a
@ -0,0 +1,187 @@
|
|||||||
|
From 918aca5b83c170b229c6449c27556ad70743f728 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangjie02 <tangjie02@kylinsec.com.cn>
|
||||||
|
Date: Tue, 4 Jan 2022 17:11:31 +0800
|
||||||
|
Subject: [PATCH] fix(xinit): Fix the dbus error when the session manager is
|
||||||
|
launched by xinit
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
- 修复通过xinit启动会话管理时,程序会卡在获取DisplayManager的dbus句柄的地方
|
||||||
|
|
||||||
|
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
|
||||||
|
---
|
||||||
|
src/client/client-manager.cpp | 2 ++
|
||||||
|
src/main.cpp | 35 +++++++++++++++++++++++++++++++++
|
||||||
|
src/presence.cpp | 2 ++
|
||||||
|
src/session-manager.cpp | 2 ++
|
||||||
|
src/ui/ui-manager.cpp | 2 ++
|
||||||
|
src/wrapper/display-manager.cpp | 24 +++++++++++++++-------
|
||||||
|
src/xsmp-server.cpp | 2 ++
|
||||||
|
7 files changed, 62 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/client/client-manager.cpp b/src/client/client-manager.cpp
|
||||||
|
index be9a75b..e5c4df2 100644
|
||||||
|
--- a/src/client/client-manager.cpp
|
||||||
|
+++ b/src/client/client-manager.cpp
|
||||||
|
@@ -61,6 +61,8 @@ std::shared_ptr<ClientDBus> ClientManager::get_client_by_dbus_name(const std::st
|
||||||
|
|
||||||
|
void ClientManager::init()
|
||||||
|
{
|
||||||
|
+ KLOG_PROFILE("");
|
||||||
|
+
|
||||||
|
this->dbus_daemon_proxy_->signal_signal().connect(sigc::mem_fun(this, &ClientManager::on_dbus_daemon_signal_cb));
|
||||||
|
this->xsmp_server_->signal_new_client_connected().connect(sigc::mem_fun(this, &ClientManager::on_new_xsmp_client_connected_cb));
|
||||||
|
this->xsmp_server_->signal_ice_conn_status_changed().connect(sigc::mem_fun(this, &ClientManager::on_ice_conn_status_changed_cb));
|
||||||
|
diff --git a/src/main.cpp b/src/main.cpp
|
||||||
|
index a5571e9..005ae0e 100644
|
||||||
|
--- a/src/main.cpp
|
||||||
|
+++ b/src/main.cpp
|
||||||
|
@@ -12,6 +12,7 @@
|
||||||
|
* Author: tangjie02 <tangjie02@kylinos.com.cn>
|
||||||
|
*/
|
||||||
|
|
||||||
|
+#include <glib.h>
|
||||||
|
#include <glib/gi18n.h>
|
||||||
|
#include <gtkmm.h>
|
||||||
|
#include "src/app/app-manager.h"
|
||||||
|
@@ -24,6 +25,37 @@
|
||||||
|
|
||||||
|
using namespace Kiran::Daemon;
|
||||||
|
|
||||||
|
+#define DBUS_LAUNCH_COMMAND "dbus-launch"
|
||||||
|
+
|
||||||
|
+bool start_dbus_session(int argc, char **argv)
|
||||||
|
+{
|
||||||
|
+ int i = 0;
|
||||||
|
+
|
||||||
|
+ RETURN_VAL_IF_TRUE(!Glib::getenv("DBUS_SESSION_BUS_ADDRESS").empty(), true);
|
||||||
|
+ RETURN_VAL_IF_TRUE(Kiran::StrUtils::startswith(argv[0], DBUS_LAUNCH_COMMAND), true);
|
||||||
|
+
|
||||||
|
+ char **new_argv = (char **)g_malloc(argc + 3 * sizeof(*argv));
|
||||||
|
+
|
||||||
|
+ new_argv[0] = (char *)DBUS_LAUNCH_COMMAND;
|
||||||
|
+ new_argv[1] = (char *)"--exit-with-session";
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < argc; i++)
|
||||||
|
+ {
|
||||||
|
+ new_argv[i + 2] = argv[i];
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ new_argv[i + 2] = NULL;
|
||||||
|
+
|
||||||
|
+ KLOG_DEBUG("Start session manager by dbus-launch.");
|
||||||
|
+
|
||||||
|
+ if (!execvp(DBUS_LAUNCH_COMMAND, new_argv))
|
||||||
|
+ {
|
||||||
|
+ KLOG_WARNING("No session bus and could not exec dbus-launch: %s", g_strerror(errno));
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ return true;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void init_env()
|
||||||
|
{
|
||||||
|
using param_type = std::map<Glib::ustring, Glib::ustring>;
|
||||||
|
@@ -72,6 +104,9 @@ int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
klog_gtk3_init(std::string(), "kylinsec-session", PROJECT_NAME, PROJECT_NAME);
|
||||||
|
|
||||||
|
+ // 这里做一个兼容性处理,当会话dbus-daemon没有启动时(一般不会出现),由会话管理进行拉起
|
||||||
|
+ start_dbus_session(argc, argv);
|
||||||
|
+
|
||||||
|
setlocale(LC_ALL, "");
|
||||||
|
bindtextdomain(PROJECT_NAME, KSM_LOCALEDIR);
|
||||||
|
bind_textdomain_codeset(PROJECT_NAME, "UTF-8");
|
||||||
|
diff --git a/src/presence.cpp b/src/presence.cpp
|
||||||
|
index 3a898d3..d0fb4ff 100644
|
||||||
|
--- a/src/presence.cpp
|
||||||
|
+++ b/src/presence.cpp
|
||||||
|
@@ -32,6 +32,8 @@ Presence::Presence() : enabled_idle_timeout_(true),
|
||||||
|
|
||||||
|
void Presence::init()
|
||||||
|
{
|
||||||
|
+ KLOG_PROFILE("");
|
||||||
|
+
|
||||||
|
this->idle_timeout_ = this->settings_->get_int(KSM_SCHEMA_KEY_IDLE_DELAY);
|
||||||
|
this->idle_xlarm_.init();
|
||||||
|
this->update_idle_xlarm();
|
||||||
|
diff --git a/src/session-manager.cpp b/src/session-manager.cpp
|
||||||
|
index d0cb95b..892c8b9 100644
|
||||||
|
--- a/src/session-manager.cpp
|
||||||
|
+++ b/src/session-manager.cpp
|
||||||
|
@@ -281,6 +281,8 @@ void SessionManager::CanReboot(MethodInvocation &invocation)
|
||||||
|
|
||||||
|
void SessionManager::init()
|
||||||
|
{
|
||||||
|
+ KLOG_PROFILE("");
|
||||||
|
+
|
||||||
|
this->power_.init();
|
||||||
|
this->presence_->init();
|
||||||
|
|
||||||
|
diff --git a/src/ui/ui-manager.cpp b/src/ui/ui-manager.cpp
|
||||||
|
index 3c5d9d2..046da89 100644
|
||||||
|
--- a/src/ui/ui-manager.cpp
|
||||||
|
+++ b/src/ui/ui-manager.cpp
|
||||||
|
@@ -32,6 +32,8 @@ void UIManager::global_init()
|
||||||
|
|
||||||
|
void UIManager::init()
|
||||||
|
{
|
||||||
|
+ KLOG_PROFILE("");
|
||||||
|
+
|
||||||
|
auto resource = Gio::Resource::create_from_file(KSM_INSTALL_DATADIR "/kiran-session-manager.gresource");
|
||||||
|
resource->register_global();
|
||||||
|
|
||||||
|
diff --git a/src/wrapper/display-manager.cpp b/src/wrapper/display-manager.cpp
|
||||||
|
index 558773d..4097056 100644
|
||||||
|
--- a/src/wrapper/display-manager.cpp
|
||||||
|
+++ b/src/wrapper/display-manager.cpp
|
||||||
|
@@ -23,15 +23,25 @@ namespace Daemon
|
||||||
|
|
||||||
|
DisplayManager::DisplayManager()
|
||||||
|
{
|
||||||
|
+ auto xdg_seat_object_path = Glib::getenv("XDG_SEAT_PATH");
|
||||||
|
+
|
||||||
|
try
|
||||||
|
{
|
||||||
|
- auto xdg_seat_object_path = Glib::getenv("XDG_SEAT_PATH");
|
||||||
|
- this->display_proxy_ = Gio::DBus::Proxy::create_for_bus_sync(Gio::DBus::BUS_TYPE_SYSTEM,
|
||||||
|
- DISPLAY_MANAGER_DBUS_NAME,
|
||||||
|
- xdg_seat_object_path,
|
||||||
|
- DISPLAY_MANAGER_DBUS_INTERFACE,
|
||||||
|
- Glib::RefPtr<Gio::DBus::InterfaceInfo>(),
|
||||||
|
- Gio::DBus::PROXY_FLAGS_DO_NOT_AUTO_START);
|
||||||
|
+ if (xdg_seat_object_path.empty())
|
||||||
|
+ {
|
||||||
|
+ KLOG_WARNING("Not found XDG_SEAT_PATH.");
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ KLOG_DEBUG("XDG_SEAT_PATH: %s.", xdg_seat_object_path.c_str());
|
||||||
|
+
|
||||||
|
+ this->display_proxy_ = Gio::DBus::Proxy::create_for_bus_sync(Gio::DBus::BUS_TYPE_SYSTEM,
|
||||||
|
+ DISPLAY_MANAGER_DBUS_NAME,
|
||||||
|
+ xdg_seat_object_path,
|
||||||
|
+ DISPLAY_MANAGER_DBUS_INTERFACE,
|
||||||
|
+ Glib::RefPtr<Gio::DBus::InterfaceInfo>(),
|
||||||
|
+ Gio::DBus::PROXY_FLAGS_DO_NOT_AUTO_START);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
catch (const Glib::Error& e)
|
||||||
|
{
|
||||||
|
diff --git a/src/xsmp-server.cpp b/src/xsmp-server.cpp
|
||||||
|
index 35a6629..75e4173 100644
|
||||||
|
--- a/src/xsmp-server.cpp
|
||||||
|
+++ b/src/xsmp-server.cpp
|
||||||
|
@@ -58,6 +58,8 @@ void XsmpServer::global_init()
|
||||||
|
|
||||||
|
void XsmpServer::init()
|
||||||
|
{
|
||||||
|
+ KLOG_PROFILE("");
|
||||||
|
+
|
||||||
|
char error_string[BUFSIZ];
|
||||||
|
SmsSetErrorHandler(&XsmpServer::on_sms_error_handler_cb);
|
||||||
|
IceSetIOErrorHandler(&XsmpServer::on_ice_io_error_handler_cb);
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
From 3d2ec38f9c4d3bd19d707ef60fefc6243d650235 Mon Sep 17 00:00:00 2001
|
||||||
|
From: tangjie02 <tangjie02@kylinsec.com.cn>
|
||||||
|
Date: Mon, 17 Jan 2022 17:24:46 +0800
|
||||||
|
Subject: [PATCH] fix(env): Some environments are filtered because the if
|
||||||
|
statement is wrong.
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
- 由于if语句写错,导致部分环境变量被过滤
|
||||||
|
|
||||||
|
Closes #48435
|
||||||
|
|
||||||
|
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
|
||||||
|
---
|
||||||
|
src/main.cpp | 8 ++++++--
|
||||||
|
src/utils.cpp | 2 +-
|
||||||
|
2 files changed, 7 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/main.cpp b/src/main.cpp
|
||||||
|
index 005ae0e..eec074c 100644
|
||||||
|
--- a/src/main.cpp
|
||||||
|
+++ b/src/main.cpp
|
||||||
|
@@ -69,10 +69,14 @@ void init_env()
|
||||||
|
for (auto key : Glib::listenv())
|
||||||
|
{
|
||||||
|
auto value = Glib::getenv(key);
|
||||||
|
- if (key_regex->match(value) && value_regex->match(value))
|
||||||
|
+ if (key_regex->match(key) && value_regex->match(value))
|
||||||
|
{
|
||||||
|
envs.emplace(key, value);
|
||||||
|
- KLOG_DEBUG("key: %s, value: %s.", key.c_str(), value.c_str());
|
||||||
|
+ KLOG_DEBUG("Add environment: %s=%s.", key.c_str(), value.c_str());
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ KLOG_WARNING("Filter environment: %s=%s.", key.c_str(), value.c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Utils::setenvs(envs);
|
||||||
|
diff --git a/src/utils.cpp b/src/utils.cpp
|
||||||
|
index b2cfb29..e70cc98 100644
|
||||||
|
--- a/src/utils.cpp
|
||||||
|
+++ b/src/utils.cpp
|
||||||
|
@@ -125,7 +125,7 @@ void Utils::setenvs(const std::map<Glib::ustring, Glib::ustring> &envs)
|
||||||
|
list_env.push_back(env);
|
||||||
|
}
|
||||||
|
|
||||||
|
- KLOG_DEBUG("envs: %s.", StrUtils::join(list_env, ";").c_str());
|
||||||
|
+ KLOG_DEBUG("Set environments: %s.", StrUtils::join(list_env, ";").c_str());
|
||||||
|
auto systemd_proxy = Gio::DBus::Proxy::create_for_bus_sync(Gio::DBus::BUS_TYPE_SESSION,
|
||||||
|
SYSTEMD_DBUS_NAME,
|
||||||
|
SYSTEMD_DBUS_OBJECT_PATH,
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
Binary file not shown.
BIN
kiran-session-manager-2.2.1.tar.gz
Normal file
BIN
kiran-session-manager-2.2.1.tar.gz
Normal file
Binary file not shown.
@ -1,11 +1,16 @@
|
|||||||
|
%global on_openeuler 1
|
||||||
|
|
||||||
Name: kiran-session-manager
|
Name: kiran-session-manager
|
||||||
Version: 2.1.2
|
Version: 2.2.1
|
||||||
Release: 1%{?dist}
|
Release: 3.kb3
|
||||||
Summary: Session manager for KIRAN desktop environment
|
Summary: Session manager for KIRAN desktop environment
|
||||||
|
|
||||||
License: Mulan PSL v2
|
License: Mulan PSL v2
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
|
|
||||||
|
Patch1001: 0000-fix-xinit-Fix-the-dbus-error-when-the-session-manage-918aca5b.patch
|
||||||
|
Patch1002: 1002-fix-env-Some-environments-are-filtered-because-the-i-3d2ec38f.patch
|
||||||
|
|
||||||
BuildRequires: cmake >= 3.2
|
BuildRequires: cmake >= 3.2
|
||||||
BuildRequires: pkgconfig(giomm-2.4)
|
BuildRequires: pkgconfig(giomm-2.4)
|
||||||
BuildRequires: pkgconfig(gtkmm-3.0)
|
BuildRequires: pkgconfig(gtkmm-3.0)
|
||||||
@ -34,7 +39,11 @@ Session manager for KIRAN desktop environment
|
|||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if 0%{?on_openeuler} == 1
|
||||||
%cmake -DSUPPORT_CAJA:BOOL=TRUE
|
%cmake -DSUPPORT_CAJA:BOOL=TRUE
|
||||||
|
%else
|
||||||
|
%cmake
|
||||||
|
%endif
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
|
||||||
@ -53,20 +62,44 @@ make %{?_smp_mflags}
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Dec 13 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.2-1
|
* Sat Jan 22 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.1-3.kb3
|
||||||
|
- KYOS-F: Comptabile openeuler.
|
||||||
|
|
||||||
|
* Wed Jan 19 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.1-2.kb3
|
||||||
|
- KYOS-F: Rebuild because of last compile failed.
|
||||||
|
|
||||||
|
* Tue Jan 18 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.1-1.kb3
|
||||||
|
- KYOS-B: Some environments are filtered because the if statement is wrong.(#48435)
|
||||||
|
|
||||||
|
* Tue Jan 04 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.1-1.kb2
|
||||||
|
- KYOS-B: Fix the dbus error when the session manager is launched by xinit.
|
||||||
|
|
||||||
|
* Tue Jan 04 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.2.1-1.kb1
|
||||||
|
- KYOS-B: Fix the compile error in KY3.3-6B.
|
||||||
|
|
||||||
|
* Wed Dec 29 2021 kpkg <kpkg@kylinos.com.cn> - 2.2.0-3.kb1
|
||||||
|
- rebuild for KY3.4-MATE-modules-dev
|
||||||
|
|
||||||
|
* Wed Dec 29 2021 caoyuanji<caoyuanji@kylinos.com.cn> - 2.2.0-3
|
||||||
|
- Upgrade version number for easy upgrade
|
||||||
|
|
||||||
|
* Mon Dec 20 2021 caoyuanji <caoyuanji@kylinos.com.cn> - 2.2.0-2.kb1
|
||||||
|
- rebuild for KY3.4-4-KiranUI-2.2
|
||||||
|
|
||||||
|
* Mon Dec 13 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.0-2.ky3
|
||||||
- KYOS-F: Show unknown applicattion when the inhibit application is not found.
|
- KYOS-F: Show unknown applicattion when the inhibit application is not found.
|
||||||
- KYOS-B: Fix the problem that cannot find the desktop file in xdg directory.
|
- KYOS-B: Fix the problem that cannot find the desktop file in xdg directory.
|
||||||
|
|
||||||
|
* Mon Nov 22 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.2.0-1.ky3
|
||||||
- KYOS-B: Use the missing app info when cannot get app info by inhibitor.
|
- KYOS-B: Use the missing app info when cannot get app info by inhibitor.
|
||||||
- KYOS-B: Add oral-autostart to blacklist to fix the key exception.
|
- KYOS-B: Add oral-autostart to blacklist to fix the key exception.
|
||||||
|
|
||||||
|
* Mon Nov 15 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.2-2.ky3
|
||||||
- KYOS-B: Delay running mate-settings-daemon for making kiran-session-daemon priority to close conflicted plugins with kiran-session-daemon.
|
- KYOS-B: Delay running mate-settings-daemon for making kiran-session-daemon priority to close conflicted plugins with kiran-session-daemon.
|
||||||
|
|
||||||
|
* Thu Sep 16 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.2-1.ky3
|
||||||
- KYOS-F: Add exit query window.
|
- KYOS-F: Add exit query window.
|
||||||
|
|
||||||
* Mon Oct 18 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.1-2
|
|
||||||
- KYOS-F: Support caja through adding macro SUPPORT_CAJA.
|
|
||||||
|
|
||||||
* Fri Oct 15 2021 xiewenhao <xiewenhao@kylinos.com.cn> 2.1.1-1.kb1
|
|
||||||
- KYOS-B: adjust caja(#43502)
|
|
||||||
|
|
||||||
* Mon Aug 09 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.1-1.ky3
|
* Mon Aug 09 2021 tangjie02 <tangjie02@kylinos.com.cn> 2.1.1-1.ky3
|
||||||
- KYOS-F: Restart app when the key X-KIRAN-AutoRestart is true and the app is exited.
|
- KYOS-F: Restart app when the key X-KIRAN-AutoRestart is true and the app is exited.
|
||||||
- KYOS-F: Remove dbus client when the dbus name is removed.
|
- KYOS-F: Remove dbus client when the dbus name is removed.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user