Update to 45.0
This commit is contained in:
parent
a3e385741c
commit
986bd07f81
1
.gitignore
vendored
1
.gitignore
vendored
@ -121,3 +121,4 @@ gnome-session-2.31.6.tar.bz2
|
|||||||
/gnome-session-43.0.tar.xz
|
/gnome-session-43.0.tar.xz
|
||||||
/gnome-session-44.rc.tar.xz
|
/gnome-session-44.rc.tar.xz
|
||||||
/gnome-session-44.0.tar.xz
|
/gnome-session-44.0.tar.xz
|
||||||
|
/gnome-session-45.0.tar.xz
|
||||||
|
@ -1,336 +0,0 @@
|
|||||||
From 6eb49bc7bc7e3362343a5e8fff4050d794a4cef5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ray Strode <rstrode@redhat.com>
|
|
||||||
Date: Wed, 6 Sep 2023 13:57:28 -0400
|
|
||||||
Subject: [PATCH] main: Fix crash if gnome-session is started more than once
|
|
||||||
|
|
||||||
gnome-session is started inside a running session it will lead
|
|
||||||
to the session crashing. That is because it hijacks the monitoring
|
|
||||||
fifo, and as soon as the nested instance exists, the systemd services
|
|
||||||
think the outer session is over.
|
|
||||||
|
|
||||||
This commit checks for the nested case and exits.
|
|
||||||
---
|
|
||||||
gnome-session/gsm-util.c | 70 ++++++++++++++++++++++++++++++++++++++++
|
|
||||||
gnome-session/gsm-util.h | 2 ++
|
|
||||||
gnome-session/main.c | 55 ++++++++++++++++++-------------
|
|
||||||
3 files changed, 105 insertions(+), 22 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/gnome-session/gsm-util.c b/gnome-session/gsm-util.c
|
|
||||||
index f2752573..f627cd6b 100644
|
|
||||||
--- a/gnome-session/gsm-util.c
|
|
||||||
+++ b/gnome-session/gsm-util.c
|
|
||||||
@@ -726,60 +726,130 @@ gsm_util_update_user_environment (const char *variable,
|
|
||||||
}
|
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
|
|
||||||
entry = g_strdup_printf ("%s=%s", variable, value);
|
|
||||||
g_variant_builder_add (&builder, "s", entry);
|
|
||||||
g_free (entry);
|
|
||||||
|
|
||||||
reply = g_dbus_connection_call_sync (connection,
|
|
||||||
"org.freedesktop.systemd1",
|
|
||||||
"/org/freedesktop/systemd1",
|
|
||||||
"org.freedesktop.systemd1.Manager",
|
|
||||||
"SetEnvironment",
|
|
||||||
g_variant_new ("(@as)",
|
|
||||||
g_variant_builder_end (&builder)),
|
|
||||||
NULL,
|
|
||||||
G_DBUS_CALL_FLAGS_NO_AUTO_START,
|
|
||||||
-1, NULL, &bus_error);
|
|
||||||
|
|
||||||
if (bus_error != NULL) {
|
|
||||||
g_propagate_error (error, bus_error);
|
|
||||||
} else {
|
|
||||||
environment_updated = TRUE;
|
|
||||||
g_variant_unref (reply);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_clear_object (&connection);
|
|
||||||
|
|
||||||
return environment_updated;
|
|
||||||
}
|
|
||||||
|
|
||||||
+gboolean
|
|
||||||
+gsm_util_systemd_unit_is_active (const char *unit,
|
|
||||||
+ GError **error)
|
|
||||||
+{
|
|
||||||
+ g_autoptr(GDBusProxy) proxy = NULL;
|
|
||||||
+ g_autoptr(GVariant) result = NULL;
|
|
||||||
+ g_autofree gchar *object_path = NULL;
|
|
||||||
+ g_autofree gchar *active_state = NULL;
|
|
||||||
+ g_autoptr(GDBusProxy) unit_proxy = NULL;
|
|
||||||
+
|
|
||||||
+ proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
|
||||||
+ G_DBUS_PROXY_FLAGS_NONE,
|
|
||||||
+ NULL,
|
|
||||||
+ "org.freedesktop.systemd1",
|
|
||||||
+ "/org/freedesktop/systemd1",
|
|
||||||
+ "org.freedesktop.systemd1.Manager",
|
|
||||||
+ NULL,
|
|
||||||
+ error);
|
|
||||||
+
|
|
||||||
+ if (proxy == NULL) {
|
|
||||||
+ return FALSE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ result = g_dbus_proxy_call_sync (proxy,
|
|
||||||
+ "GetUnit",
|
|
||||||
+ g_variant_new ("(s)", unit),
|
|
||||||
+ G_DBUS_CALL_FLAGS_NONE,
|
|
||||||
+ -1,
|
|
||||||
+ NULL,
|
|
||||||
+ error);
|
|
||||||
+
|
|
||||||
+ if (result == NULL) {
|
|
||||||
+ if (error && *error) {
|
|
||||||
+ g_autofree char *remote_error = g_dbus_error_get_remote_error (*error);
|
|
||||||
+
|
|
||||||
+ if (g_strcmp0 (remote_error, "org.freedesktop.systemd1.NoSuchUnit") == 0) {
|
|
||||||
+ g_clear_error (error);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return FALSE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ g_variant_get (result, "(o)", &object_path);
|
|
||||||
+ g_clear_pointer (&result, g_variant_unref);
|
|
||||||
+
|
|
||||||
+ unit_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
|
||||||
+ G_DBUS_PROXY_FLAGS_NONE,
|
|
||||||
+ NULL,
|
|
||||||
+ "org.freedesktop.systemd1",
|
|
||||||
+ object_path,
|
|
||||||
+ "org.freedesktop.systemd1.Unit",
|
|
||||||
+ NULL,
|
|
||||||
+ error);
|
|
||||||
+
|
|
||||||
+ if (unit_proxy == NULL) {
|
|
||||||
+ return FALSE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ result = g_dbus_proxy_get_cached_property (unit_proxy, "ActiveState");
|
|
||||||
+
|
|
||||||
+ if (result == NULL) {
|
|
||||||
+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_PROPERTY, "Error getting ActiveState property");
|
|
||||||
+ return FALSE;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ g_variant_get (result, "s", &active_state);
|
|
||||||
+
|
|
||||||
+ return g_str_equal (active_state, "active");
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
gboolean
|
|
||||||
gsm_util_start_systemd_unit (const char *unit,
|
|
||||||
const char *mode,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
g_autoptr(GDBusConnection) connection = NULL;
|
|
||||||
g_autoptr(GVariant) reply = NULL;
|
|
||||||
GError *bus_error = NULL;
|
|
||||||
|
|
||||||
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error);
|
|
||||||
|
|
||||||
if (connection == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
reply = g_dbus_connection_call_sync (connection,
|
|
||||||
"org.freedesktop.systemd1",
|
|
||||||
"/org/freedesktop/systemd1",
|
|
||||||
"org.freedesktop.systemd1.Manager",
|
|
||||||
"StartUnit",
|
|
||||||
g_variant_new ("(ss)",
|
|
||||||
unit, mode),
|
|
||||||
NULL,
|
|
||||||
G_DBUS_CALL_FLAGS_NO_AUTO_START,
|
|
||||||
-1, NULL, &bus_error);
|
|
||||||
|
|
||||||
if (bus_error != NULL) {
|
|
||||||
g_propagate_error (error, bus_error);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/gnome-session/gsm-util.h b/gnome-session/gsm-util.h
|
|
||||||
index bc26a21e..9bba07ed 100644
|
|
||||||
--- a/gnome-session/gsm-util.h
|
|
||||||
+++ b/gnome-session/gsm-util.h
|
|
||||||
@@ -28,42 +28,44 @@ char * gsm_util_find_desktop_file_for_app_name (const char *app_name,
|
|
||||||
gboolean look_in_saved_session,
|
|
||||||
gboolean autostart_first);
|
|
||||||
|
|
||||||
gchar *gsm_util_get_empty_tmp_session_dir (void);
|
|
||||||
|
|
||||||
const char *gsm_util_get_saved_session_dir (void);
|
|
||||||
|
|
||||||
gchar** gsm_util_get_app_dirs (void);
|
|
||||||
|
|
||||||
gchar** gsm_util_get_autostart_dirs (void);
|
|
||||||
void gsm_util_set_autostart_dirs (char **dirs);
|
|
||||||
|
|
||||||
gchar ** gsm_util_get_desktop_dirs (gboolean include_saved_session,
|
|
||||||
gboolean autostart_first);
|
|
||||||
|
|
||||||
gboolean gsm_util_text_is_blank (const char *str);
|
|
||||||
|
|
||||||
void gsm_util_init_error (gboolean fatal,
|
|
||||||
const char *format, ...) G_GNUC_PRINTF (2, 3);
|
|
||||||
|
|
||||||
char * gsm_util_generate_startup_id (void);
|
|
||||||
|
|
||||||
void gsm_util_setenv (const char *variable,
|
|
||||||
const char *value);
|
|
||||||
const char * const * gsm_util_listenv (void);
|
|
||||||
const char * const * gsm_util_get_variable_blacklist(void);
|
|
||||||
|
|
||||||
gboolean gsm_util_export_activation_environment (GError **error);
|
|
||||||
#ifdef HAVE_SYSTEMD
|
|
||||||
gboolean gsm_util_export_user_environment (GError **error);
|
|
||||||
+gboolean gsm_util_systemd_unit_is_active (const char *unit,
|
|
||||||
+ GError **error);
|
|
||||||
gboolean gsm_util_start_systemd_unit (const char *unit,
|
|
||||||
const char *mode,
|
|
||||||
GError **error);
|
|
||||||
gboolean gsm_util_systemd_reset_failed (GError **error);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void gsm_quit (void);
|
|
||||||
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GSM_UTIL_H__ */
|
|
||||||
diff --git a/gnome-session/main.c b/gnome-session/main.c
|
|
||||||
index 3ae85225..db8fd97a 100644
|
|
||||||
--- a/gnome-session/main.c
|
|
||||||
+++ b/gnome-session/main.c
|
|
||||||
@@ -527,94 +527,105 @@ main (int argc, char **argv)
|
|
||||||
gsm_util_set_autostart_dirs (env_override_autostart_dirs_v);
|
|
||||||
} else {
|
|
||||||
gsm_util_set_autostart_dirs (override_autostart_dirs);
|
|
||||||
|
|
||||||
/* Export the override autostart dirs parameter to the environment
|
|
||||||
* in case we are running on systemd. */
|
|
||||||
if (override_autostart_dirs) {
|
|
||||||
g_autofree char *autostart_dirs = NULL;
|
|
||||||
autostart_dirs = g_strjoinv (":", override_autostart_dirs);
|
|
||||||
g_setenv ("GNOME_SESSION_AUTOSTART_DIR", autostart_dirs, TRUE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gsm_util_export_activation_environment (&error);
|
|
||||||
if (error) {
|
|
||||||
g_warning ("Failed to upload environment to DBus: %s", error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
}
|
|
||||||
|
|
||||||
session_name = opt_session_name;
|
|
||||||
|
|
||||||
#ifdef HAVE_SYSTEMD
|
|
||||||
gsm_util_export_user_environment (&error);
|
|
||||||
if (error && !g_getenv ("RUNNING_UNDER_GDM"))
|
|
||||||
g_warning ("Failed to upload environment to systemd: %s", error->message);
|
|
||||||
g_clear_error (&error);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ENABLE_SYSTEMD_SESSION
|
|
||||||
if (use_systemd && !systemd_service) {
|
|
||||||
- g_autofree gchar *gnome_session_target;
|
|
||||||
- const gchar *session_type;
|
|
||||||
+ const gchar *session_type = NULL;
|
|
||||||
+ g_autofree gchar *gnome_session_target = NULL;
|
|
||||||
|
|
||||||
session_type = g_getenv ("XDG_SESSION_TYPE");
|
|
||||||
|
|
||||||
/* We really need to resolve the session name at this point,
|
|
||||||
* which requires talking to GSettings internally. */
|
|
||||||
if (IS_STRING_EMPTY (session_name)) {
|
|
||||||
session_name = _gsm_manager_get_default_session (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
- /* Reset all failed units; we are going to start a lof ot things and
|
|
||||||
- * really do not want to run into errors because units have failed
|
|
||||||
- * in a previous session
|
|
||||||
- */
|
|
||||||
- gsm_util_systemd_reset_failed (&error);
|
|
||||||
- if (error && !g_getenv ("RUNNING_UNDER_GDM"))
|
|
||||||
- g_warning ("Failed to reset failed state of units: %s", error->message);
|
|
||||||
- g_clear_error (&error);
|
|
||||||
-
|
|
||||||
/* We don't escape the name (i.e. we leave any '-' intact). */
|
|
||||||
gnome_session_target = g_strdup_printf ("gnome-session-%s@%s.target", session_type, session_name);
|
|
||||||
- if (gsm_util_start_systemd_unit (gnome_session_target, "fail", &error)) {
|
|
||||||
- /* We started the unit, open fifo and sleep forever. */
|
|
||||||
- systemd_leader_run ();
|
|
||||||
- exit(0);
|
|
||||||
- }
|
|
||||||
|
|
||||||
- /* We could not start the unit, fall back. */
|
|
||||||
- if (g_getenv ("RUNNING_UNDER_GDM"))
|
|
||||||
- g_message ("Falling back to non-systemd startup procedure. This is expected to happen for GDM sessions.");
|
|
||||||
- else
|
|
||||||
- g_warning ("Falling back to non-systemd startup procedure due to error: %s", error->message);
|
|
||||||
- g_clear_error (&error);
|
|
||||||
+ if (!gsm_util_systemd_unit_is_active (gnome_session_target, &error)) {
|
|
||||||
+ if (error != NULL) {
|
|
||||||
+ g_warning ("Could not check if unit %s is active: %s",
|
|
||||||
+ gnome_session_target, error->message);
|
|
||||||
+ g_clear_error (&error);
|
|
||||||
+ }
|
|
||||||
+ /* Reset all failed units; we are going to start a lof ot things and
|
|
||||||
+ * really do not want to run into errors because units have failed
|
|
||||||
+ * in a previous session
|
|
||||||
+ */
|
|
||||||
+ gsm_util_systemd_reset_failed (&error);
|
|
||||||
+ if (error && !g_getenv ("RUNNING_UNDER_GDM"))
|
|
||||||
+ g_warning ("Failed to reset failed state of units: %s", error->message);
|
|
||||||
+ g_clear_error (&error);
|
|
||||||
+
|
|
||||||
+ if (gsm_util_start_systemd_unit (gnome_session_target, "fail", &error)) {
|
|
||||||
+ /* We started the unit, open fifo and sleep forever. */
|
|
||||||
+ systemd_leader_run ();
|
|
||||||
+ exit (0);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* We could not start the unit, fall back. */
|
|
||||||
+ if (g_getenv ("RUNNING_UNDER_GDM"))
|
|
||||||
+ g_message ("Falling back to non-systemd startup procedure. This is expected to happen for GDM sessions.");
|
|
||||||
+ else
|
|
||||||
+ g_warning ("Falling back to non-systemd startup procedure due to error: %s", error->message);
|
|
||||||
+ g_clear_error (&error);
|
|
||||||
+ } else {
|
|
||||||
+ g_warning ("Session manager already running!");
|
|
||||||
+ exit (1);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
#endif /* ENABLE_SYSTEMD_SESSION */
|
|
||||||
|
|
||||||
{
|
|
||||||
gchar *ibus_path;
|
|
||||||
|
|
||||||
ibus_path = g_find_program_in_path("ibus-daemon");
|
|
||||||
|
|
||||||
if (ibus_path) {
|
|
||||||
const gchar *p;
|
|
||||||
p = g_getenv ("QT_IM_MODULE");
|
|
||||||
if (!p || !*p)
|
|
||||||
p = "ibus";
|
|
||||||
gsm_util_setenv ("QT_IM_MODULE", p);
|
|
||||||
p = g_getenv ("XMODIFIERS");
|
|
||||||
if (!p || !*p)
|
|
||||||
p = "@im=ibus";
|
|
||||||
gsm_util_setenv ("XMODIFIERS", p);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (ibus_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We want to use the GNOME menus which has the designed categories.
|
|
||||||
*/
|
|
||||||
gsm_util_setenv ("XDG_MENU_PREFIX", "gnome-");
|
|
||||||
|
|
||||||
/* Talk to logind before acquiring a name, since it does synchronous
|
|
||||||
* calls at initialization time that invoke a main loop and if we
|
|
||||||
* already owned a name, then we would service too early during
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
|||||||
From 353a43f81877d23b347c04c30e7ebc861f39c468 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
|
||||||
Date: Tue, 22 Aug 2023 18:20:36 -0300
|
|
||||||
Subject: [PATCH] data: Add gnome-portals.conf
|
|
||||||
|
|
||||||
Now that xdg-desktop-portal handles portal implementations using
|
|
||||||
a well-defined config file, let's ship the GNOME blend of portals
|
|
||||||
in gnome-portals.conf. Install it under datadir/xdg-desktop-portal,
|
|
||||||
which usually would resolve to /usr/share/xdg-desktop-portal.
|
|
||||||
|
|
||||||
Closes: https://gitlab.gnome.org/GNOME/gnome-session/-/issues/114
|
|
||||||
---
|
|
||||||
data/gnome-portals.conf | 4 ++++
|
|
||||||
data/meson.build | 5 +++++
|
|
||||||
2 files changed, 9 insertions(+)
|
|
||||||
create mode 100644 data/gnome-portals.conf
|
|
||||||
|
|
||||||
diff --git a/data/gnome-portals.conf b/data/gnome-portals.conf
|
|
||||||
new file mode 100644
|
|
||||||
index 00000000..198e6445
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/data/gnome-portals.conf
|
|
||||||
@@ -0,0 +1,4 @@
|
|
||||||
+[preferred]
|
|
||||||
+default=gnome;gtk;
|
|
||||||
+org.freedesktop.impl.portal.Access=gnome-shell;gtk;
|
|
||||||
+org.freedesktop.impl.portal.Secret=gnome-keyring;
|
|
||||||
diff --git a/data/meson.build b/data/meson.build
|
|
||||||
index f6d264f8..f37924b8 100644
|
|
||||||
--- a/data/meson.build
|
|
||||||
+++ b/data/meson.build
|
|
||||||
@@ -195,3 +195,8 @@ install_data(
|
|
||||||
data,
|
|
||||||
install_dir: session_pkgdatadir
|
|
||||||
)
|
|
||||||
+
|
|
||||||
+install_data(
|
|
||||||
+ 'gnome-portals.conf',
|
|
||||||
+ install_dir: session_datadir / 'xdg-desktop-portal',
|
|
||||||
+)
|
|
||||||
--
|
|
||||||
GitLab
|
|
@ -1,4 +1,4 @@
|
|||||||
%define po_package gnome-session-44
|
%define po_package gnome-session-45
|
||||||
|
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
%else
|
%else
|
||||||
@ -8,13 +8,13 @@
|
|||||||
%global tarball_version %%(echo %{version} | tr '~' '.')
|
%global tarball_version %%(echo %{version} | tr '~' '.')
|
||||||
|
|
||||||
Name: gnome-session
|
Name: gnome-session
|
||||||
Version: 44.0
|
Version: 45.0
|
||||||
Release: %autorelease
|
Release: %autorelease
|
||||||
Summary: GNOME session manager
|
Summary: GNOME session manager
|
||||||
|
|
||||||
License: GPL-2.0-or-later
|
License: GPL-2.0-or-later
|
||||||
URL: https://gitlab.gnome.org/GNOME/gnome-session
|
URL: https://gitlab.gnome.org/GNOME/gnome-session
|
||||||
Source0: https://download.gnome.org/sources/gnome-session/44/%{name}-%{tarball_version}.tar.xz
|
Source0: https://download.gnome.org/sources/gnome-session/45/%{name}-%{tarball_version}.tar.xz
|
||||||
|
|
||||||
# Blacklist NV30: https://bugzilla.redhat.com/show_bug.cgi?id=745202
|
# Blacklist NV30: https://bugzilla.redhat.com/show_bug.cgi?id=745202
|
||||||
Patch: gnome-session-3.3.92-nv30.patch
|
Patch: gnome-session-3.3.92-nv30.patch
|
||||||
@ -25,12 +25,6 @@ Patch: 0001-check-accelerated-gles-Use-eglGetPlatformDisplay-EXT.patch
|
|||||||
# This should go upstream once systemd has a generic interface for this
|
# This should go upstream once systemd has a generic interface for this
|
||||||
Patch: 0001-Fedora-Set-grub-boot-flags-on-shutdown-reboot.patch
|
Patch: 0001-Fedora-Set-grub-boot-flags-on-shutdown-reboot.patch
|
||||||
|
|
||||||
# https://gitlab.gnome.org/GNOME/gnome-session/-/merge_requests/96
|
|
||||||
Patch: 0001-main-Fix-crash-if-gnome-session-is-started-more-than.patch
|
|
||||||
|
|
||||||
# https://gitlab.gnome.org/GNOME/gnome-session/-/merge_requests/95
|
|
||||||
Patch: gnome-session-add-gnome-portals-conf.patch
|
|
||||||
|
|
||||||
BuildRequires: meson
|
BuildRequires: meson
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: pkgconfig(egl)
|
BuildRequires: pkgconfig(egl)
|
||||||
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (gnome-session-44.0.tar.xz) = 0e8672531bc1818cfb6dbb5b133374e4041ec471e04968a587a93d0ee9697393ee976e1aa5dfacf707a46d816da6be6b1ef52e89f47d9d206a319eb79aae1078
|
SHA512 (gnome-session-45.0.tar.xz) = 3eb3b4b9fcab2ec35bb61bac6257b254f142167250bbc1eb71d46aed350372f8942601c9d5ca5856e8686b53b70321f914cb55f1639daecfe6c61d84cb6d8aba
|
||||||
|
Loading…
Reference in New Issue
Block a user