summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <halfline@gmail.com>2021-03-15 13:42:33 +0000
committerRay Strode <halfline@gmail.com>2021-03-15 13:42:33 +0000
commit41b8f0d2a007197f2222c9d4aae98a6e20d253c9 (patch)
tree4e7cd57ff865bbfc6e00f1f106212e7b4c50e4ee
parent6e0d2d74b4ba8fe003e0e0e4528adfd14435df92 (diff)
parent527186cef3d87c641e0f767a59a6f23d24118e72 (diff)
downloadgdm-41b8f0d2a007197f2222c9d4aae98a6e20d253c9.tar.gz
Merge branch 'benzea/fix-conversation-error-reporting' into 'master'
session: Initialize DBus error domain before resolving errors See merge request GNOME/gdm!132
-rw-r--r--daemon/gdm-dbus-util.c14
-rw-r--r--daemon/gdm-dbus-util.h2
-rw-r--r--daemon/gdm-session.c3
3 files changed, 19 insertions, 0 deletions
diff --git a/daemon/gdm-dbus-util.c b/daemon/gdm-dbus-util.c
index b71da7fd..844d60ab 100644
--- a/daemon/gdm-dbus-util.c
+++ b/daemon/gdm-dbus-util.c
@@ -183,3 +183,17 @@ gdm_dbus_get_uid_for_name (const char *system_bus_name,
return retval;
}
+
+void
+gdm_dbus_error_ensure (GQuark domain)
+{
+ /* The primary purpose of this function is to make sure the error quark
+ * is registered internally with gdbus before any bus traffic occurs,
+ * so we get remote errors mapped correctly to their local counterparts.
+ * This error quark registration happens implicitly the first time the
+ * quark is used.
+ * Note that g_debug is never optimized away, only the output is suppressed.
+ */
+ g_debug ("GdmDBusUtils: Registered DBus error domain '%s'",
+ g_quark_to_string (domain));
+}
diff --git a/daemon/gdm-dbus-util.h b/daemon/gdm-dbus-util.h
index 47654de2..32dc3196 100644
--- a/daemon/gdm-dbus-util.h
+++ b/daemon/gdm-dbus-util.h
@@ -35,4 +35,6 @@ gboolean gdm_dbus_get_pid_for_name (const char *system_bus_name,
gboolean gdm_dbus_get_uid_for_name (const char *system_bus_name,
uid_t *out_uid,
GError **error);
+
+void gdm_dbus_error_ensure (GQuark domain);
#endif
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index a6f00b66..5c5903a4 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -3998,6 +3998,9 @@ gdm_session_class_init (GdmSessionClass *session_class)
FALSE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
#endif
+
+ /* Ensure we can resolve errors */
+ gdm_dbus_error_ensure (GDM_SESSION_WORKER_ERROR);
}
GdmSession *