1 Star 0 Fork 25

lyn/gdm

forked from src-openEuler/gdm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-daemon-Don-t-error-on-shutdown.patch 4.85 KB
一键复制 编辑 原始数据 按行查看 历史
lyn 提交于 2024-04-07 18:09 . fix daemon Don't error on shutdown
From 4d2bc475545fb03c6fbba71796da08a53ab0b58e Mon Sep 17 00:00:00 2001
From: lyn1001 <[email protected]>
Date: Sun, 7 Apr 2024 17:59:15 +0800
Subject: [PATCH] fix daemon Don't error on shutdown
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index 39430a5..eecff1e 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -93,6 +93,7 @@ typedef struct _GdmDisplayPrivate
guint have_existing_user_accounts : 1;
guint doing_initial_setup : 1;
guint session_registered : 1;
+ guint shutting_down : 1;
GStrv supported_session_types;
} GdmDisplayPrivate;
@@ -119,6 +120,7 @@ enum {
PROP_DOING_INITIAL_SETUP,
PROP_SESSION_REGISTERED,
PROP_SUPPORTED_SESSION_TYPES,
+ PROP_SHUTTING_DOWN,
};
static void gdm_display_class_init (GdmDisplayClass *klass);
@@ -683,8 +685,7 @@ gdm_display_unmanage (GdmDisplay *self)
g_object_unref (priv->access_file);
priv->access_file = NULL;
}
-
- if (!priv->session_registered) {
+ if (!priv->session_registered && !priv->shutting_down) {
g_warning ("GdmDisplay: Session never registered, failing");
_gdm_display_set_status (self, GDM_DISPLAY_FAILED);
} else {
@@ -870,6 +871,16 @@ _gdm_display_set_session_registered (GdmDisplay *self,
priv->session_registered = registered;
}
+static void
+_gdm_display_set_shutting_down (GdmDisplay *self,
+ gboolean shutting_down)
+{
+ GdmDisplayPrivate *priv;
+
+ priv = gdm_display_get_instance_private (self);
+ priv->shutting_down = shutting_down;
+}
+
static void
_gdm_display_set_launch_environment (GdmDisplay *self,
GdmLaunchEnvironment *launch_environment)
@@ -981,6 +992,9 @@ gdm_display_set_property (GObject *object,
case PROP_SUPPORTED_SESSION_TYPES:
_gdm_display_set_supported_session_types (self, g_value_get_boxed (value));
break;
+ case PROP_SHUTTING_DOWN:
+ _gdm_display_set_shutting_down (self, g_value_get_boolean (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1062,6 +1076,9 @@ gdm_display_get_property (GObject *object,
case PROP_SUPPORTED_SESSION_TYPES:
g_value_set_boxed (value, priv->supported_session_types);
break;
+ case PROP_SHUTTING_DOWN:
+ g_value_set_boolean (value, priv->shutting_down);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1406,6 +1423,13 @@ gdm_display_class_init (GdmDisplayClass *klass)
"supported session types",
G_TYPE_STRV,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (object_class,
+ PROP_SHUTTING_DOWN,
+ g_param_spec_boolean ("shutting-down",
+ NULL, NULL,
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index 0e0f30c..e2c1890 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -2750,11 +2750,14 @@ unexport_display (const char *id,
}
static void
-finish_display (const char *id,
- GdmDisplay *display,
- GdmManager *manager)
+shut_down_display (const char *id,
+ GdmDisplay *display,
+ GdmManager *manager)
{
gdm_display_stop_greeter_session (display);
+
+ g_object_set (G_OBJECT (display), "shutting-down", TRUE, NULL);
+
if (gdm_display_get_status (display) == GDM_DISPLAY_MANAGED)
gdm_display_unmanage (display);
gdm_display_finish (display);
@@ -2806,7 +2809,7 @@ gdm_manager_dispose (GObject *object)
}
gdm_display_store_foreach (manager->display_store,
- (GdmDisplayStoreFunc) finish_display,
+ (GdmDisplayStoreFunc) shut_down_display,
manager);
gdm_display_store_clear (manager->display_store);
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lyn1001/gdm.git
[email protected]:lyn1001/gdm.git
lyn1001
gdm
gdm
master

搜索帮助