public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/cinnamon-session] f44: Use commit for patch
@ 2026-06-16 19:24 Leigh Scott
  0 siblings, 0 replies; only message in thread
From: Leigh Scott @ 2026-06-16 19:24 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/cinnamon-session
Branch : f44
Commit : de7771e0901218eb4f1894239a788f0b4c9d8ce0
Author : Leigh Scott <leigh123linux@gmail.com>
Date   : 2026-06-16T20:24:23+01:00
Stats  : +110/-228 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/cinnamon-session/c/de7771e0901218eb4f1894239a788f0b4c9d8ce0?branch=f44

Log:
Use commit for patch

---
diff --git a/Add-graphical-session.patch b/Add-graphical-session.patch
index 20a680d..7996a57 100644
--- a/Add-graphical-session.patch
+++ b/Add-graphical-session.patch
@@ -1,286 +1,143 @@
-From 9ac875af36f878e1696dcd49ce52bb6f6ed07cb2 Mon Sep 17 00:00:00 2001
+From e01c8c37f6bb5458cc8f38ad73e23d232e7f932a Mon Sep 17 00:00:00 2001
 From: Leigh Scott <leigh123linux@gmail.com>
-Date: Tue, 26 May 2026 22:41:55 +0100
-Subject: [PATCH] Add graphical-session
+Date: Mon, 1 Jun 2026 17:06:51 +0100
+Subject: [PATCH] session: Add graphical-session.target support (#204)
 
+Activate the cross-desktop graphical-session.target and
+graphical-session-pre.target when the Cinnamon session starts, so
+that systemd-managed services which declare WantedBy= or PartOf=
+against those targets are started and stopped in sync with the
+session.
 ---
- cinnamon-session/csm-manager.c                |   3 +
- cinnamon-session/csm-util.c                   | 195 ++++++++++++++++++
- cinnamon-session/csm-util.h                   |   7 +
- cinnamon-session/main.c                       |   7 +
- data/meson.build                              |   3 +
- data/systemd/user/cinnamon-session-pre.target |   6 +
- data/systemd/user/cinnamon-session.target     |  10 +
- data/systemd/user/meson.build                 |   7 +
- meson.build                                   |   9 +
- 9 files changed, 247 insertions(+)
- create mode 100644 data/systemd/user/cinnamon-session-pre.target
+ cinnamon-session/csm-manager.c            |  3 ++
+ cinnamon-session/csm-util.c               | 66 +++++++++++++++++++++++
+ cinnamon-session/csm-util.h               |  7 +++
+ data/meson.build                          |  3 ++
+ data/systemd/user/cinnamon-session.target | 14 +++++
+ data/systemd/user/meson.build             |  8 +++
+ debian/cinnamon-session.install           |  1 +
+ meson.build                               | 17 ++++++
+ meson_options.txt                         |  2 +
+ 9 files changed, 121 insertions(+)
  create mode 100644 data/systemd/user/cinnamon-session.target
  create mode 100644 data/systemd/user/meson.build
 
 diff --git a/cinnamon-session/csm-manager.c b/cinnamon-session/csm-manager.c
-index 9d7e8d1..0812c78 100644
+index 9d7e8d1..6b7fc29 100644
 --- a/cinnamon-session/csm-manager.c
 +++ b/cinnamon-session/csm-manager.c
-@@ -953,6 +953,8 @@ _client_stop (const char *id,
- static void
- do_phase_exit (CsmManager *manager)
- {
-+        csm_util_stop_systemd_unit ("cinnamon-session.target", NULL);
+@@ -873,6 +873,8 @@ do_phase_end_session (CsmManager *manager)
+ 
+         close_end_session_dialog (manager);
+ 
++        csm_util_stop_systemd_unit ("cinnamon-session.target", "replace", NULL);
 +
-         if (csm_store_size (manager->priv->clients) > 0) {
-                 csm_store_foreach (manager->priv->clients,
-                                    (CsmStoreFunc)_client_stop,
+         if (manager->priv->logout_mode == CSM_MANAGER_LOGOUT_MODE_FORCE) {
+                 data.flags |= CSM_CLIENT_END_SESSION_FLAG_FORCEFUL;
+         }
 @@ -1523,6 +1525,7 @@ start_phase (CsmManager *manager)
                  csm_xsmp_server_start_accepting_new_clients (manager->priv->xsmp_server);
                  csm_exported_manager_emit_session_running (manager->priv->skeleton);
                  update_idle (manager);
-+                csm_util_start_systemd_unit ("cinnamon-session.target", NULL);
++                csm_util_start_systemd_unit ("cinnamon-session.target", "replace", NULL);
                  break;
          case CSM_MANAGER_PHASE_QUERY_END_SESSION:
                  csm_xsmp_server_stop_accepting_new_clients (manager->priv->xsmp_server);
 diff --git a/cinnamon-session/csm-util.c b/cinnamon-session/csm-util.c
-index 676b63a..029d71d 100644
+index 676b63a..76dd6c6 100644
 --- a/cinnamon-session/csm-util.c
 +++ b/cinnamon-session/csm-util.c
-@@ -763,6 +763,201 @@ csm_util_update_user_environment (const char  *variable,
+@@ -763,6 +763,72 @@ csm_util_update_user_environment (const char  *variable,
          return environment_updated;
  }
  
-+static const char * const csm_systemd_env_denylist[] = {
-+        "XDG_SESSION_ID",
-+        "XDG_SESSION_TYPE",
-+        "XDG_SESSION_CLASS",
-+        "XDG_SESSION_DESKTOP",
-+        "XDG_SEAT",
-+        "XDG_VTNR",
-+        "NOTIFY_SOCKET",
-+        NULL
-+};
-+
 +gboolean
-+csm_util_export_systemd_activation_environment (GError **error)
++csm_util_start_systemd_unit (const char  *unit,
++                             const char  *mode,
++                             GError     **error)
 +{
-+        GDBusConnection *connection;
-+        GVariantBuilder  builder;
-+        GVariant        *reply;
++        g_autoptr(GDBusConnection) connection = NULL;
++        g_autoptr(GVariant)        reply = NULL;
 +        GError          *bus_error = NULL;
-+        GRegex          *name_regex, *value_regex;
-+        char           **entry_names;
-+        int              i = 0;
-+        gboolean         environment_updated = FALSE;
-+
-+        if (access ("/run/systemd/private", F_OK) != 0)
-+                return TRUE;
 +
 +        connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error);
-+        if (connection == NULL)
-+                return FALSE;
-+
-+        name_regex = g_regex_new ("^[a-zA-Z_][a-zA-Z0-9_]*$",
-+                                  G_REGEX_OPTIMIZE, 0, error);
-+        if (name_regex == NULL) {
-+                g_object_unref (connection);
-+                return FALSE;
-+        }
-+
-+        value_regex = g_regex_new ("^([[:blank:]]|[^[:cntrl:]])*$",
-+                                   G_REGEX_OPTIMIZE, 0, error);
-+        if (value_regex == NULL) {
-+                g_regex_unref (name_regex);
-+                g_object_unref (connection);
-+                return FALSE;
-+        }
-+
-+        g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
-+
-+        entry_names = g_listenv ();
-+        for (i = 0; entry_names[i] != NULL; i++) {
-+                const char *entry_name  = entry_names[i];
-+                const char *entry_value = g_getenv (entry_name);
-+
-+                if (g_strv_contains (csm_systemd_env_denylist, entry_name))
-+                        continue;
-+
-+                if (!g_utf8_validate (entry_name, -1, NULL))
-+                        continue;
-+
-+                if (!g_regex_match (name_regex, entry_name, 0, NULL))
-+                        continue;
-+
-+                if (entry_value == NULL)
-+                        continue;
-+
-+                if (!g_utf8_validate (entry_value, -1, NULL))
-+                        continue;
-+
-+                if (!g_regex_match (value_regex, entry_value, 0, NULL))
-+                        continue;
-+
-+                g_variant_builder_add (&builder, "s",
-+                                       g_strdup_printf ("%s=%s",
-+                                                        entry_name,
-+                                                        entry_value));
-+        }
-+        g_regex_unref (name_regex);
-+        g_regex_unref (value_regex);
-+        g_strfreev (entry_names);
-+
-+        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_NONE,
-+                                             -1, NULL, &bus_error);
-+
-+        if (bus_error != NULL) {
-+                g_warning ("csm_util_export_systemd_activation_environment: "
-+                           "failed to export to systemd: %s",
-+                           bus_error->message);
-+                if (error != NULL)
-+                        g_propagate_error (error, bus_error);
-+                else
-+                        g_error_free (bus_error);
-+        } else {
-+                environment_updated = TRUE;
-+                g_variant_unref (reply);
-+        }
-+
-+        g_object_unref (connection);
-+        return environment_updated;
-+}
 +
-+gboolean
-+csm_util_start_systemd_unit (const char *unit,
-+                              GError    **error)
-+{
-+        GDBusConnection *connection;
-+        GVariant        *reply;
-+        GError          *bus_error = NULL;
-+        gboolean         ret = FALSE;
-+
-+        if (access ("/run/systemd/private", F_OK) != 0)
-+                return TRUE;
-+
-+        connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error);
 +        if (connection == NULL)
 +                return FALSE;
 +
-+        g_debug ("csm_util_start_systemd_unit: starting %s", unit);
-+
 +        reply = g_dbus_connection_call_sync (connection,
 +                                             "org.freedesktop.systemd1",
 +                                             "/org/freedesktop/systemd1",
 +                                             "org.freedesktop.systemd1.Manager",
 +                                             "StartUnit",
-+                                             g_variant_new ("(ss)", unit, "replace"),
-+                                             G_VARIANT_TYPE ("(o)"),
++                                             g_variant_new ("(ss)",
++                                                            unit, mode),
++                                             NULL,
 +                                             G_DBUS_CALL_FLAGS_NONE,
 +                                             -1, NULL, &bus_error);
 +
 +        if (bus_error != NULL) {
-+                g_warning ("csm_util_start_systemd_unit: failed to start %s: %s",
-+                           unit, bus_error->message);
-+                if (error != NULL)
-+                        g_propagate_error (error, bus_error);
-+                else
-+                        g_error_free (bus_error);
-+        } else {
-+                ret = TRUE;
-+                g_variant_unref (reply);
++                g_propagate_error (error, bus_error);
++                return FALSE;
 +        }
 +
-+        g_object_unref (connection);
-+        return ret;
++        return TRUE;
 +}
 +
 +gboolean
-+csm_util_stop_systemd_unit (const char *unit,
-+                             GError    **error)
++csm_util_stop_systemd_unit (const char  *unit,
++                             const char  *mode,
++                             GError     **error)
 +{
-+        GDBusConnection *connection;
-+        GVariant        *reply;
++        g_autoptr(GDBusConnection) connection = NULL;
++        g_autoptr(GVariant)        reply = NULL;
 +        GError          *bus_error = NULL;
-+        gboolean         ret = FALSE;
-+
-+        if (access ("/run/systemd/private", F_OK) != 0)
-+                return TRUE;
 +
 +        connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, error);
++
 +        if (connection == NULL)
 +                return FALSE;
 +
-+        g_debug ("csm_util_stop_systemd_unit: stopping %s", unit);
-+
 +        reply = g_dbus_connection_call_sync (connection,
 +                                             "org.freedesktop.systemd1",
 +                                             "/org/freedesktop/systemd1",
 +                                             "org.freedesktop.systemd1.Manager",
 +                                             "StopUnit",
-+                                             g_variant_new ("(ss)", unit, "replace"),
-+                                             G_VARIANT_TYPE ("(o)"),
++                                             g_variant_new ("(ss)",
++                                                            unit, mode),
++                                             NULL,
 +                                             G_DBUS_CALL_FLAGS_NONE,
 +                                             -1, NULL, &bus_error);
 +
 +        if (bus_error != NULL) {
-+                g_debug ("csm_util_stop_systemd_unit: failed to stop %s: %s",
-+                         unit, bus_error->message);
-+                if (error != NULL)
-+                        g_propagate_error (error, bus_error);
-+                else
-+                        g_error_free (bus_error);
-+        } else {
-+                ret = TRUE;
-+                g_variant_unref (reply);
++                g_propagate_error (error, bus_error);
++                return FALSE;
 +        }
 +
-+        g_object_unref (connection);
-+        return ret;
++        return TRUE;
 +}
 +
  void
  csm_util_setenv (const char *variable,
                   const char *value)
 diff --git a/cinnamon-session/csm-util.h b/cinnamon-session/csm-util.h
-index 4d93c10..d1562f4 100644
+index 4d93c10..601df2e 100644
 --- a/cinnamon-session/csm-util.h
 +++ b/cinnamon-session/csm-util.h
 @@ -58,6 +58,13 @@ gboolean    csm_util_export_user_environment        (GError     **error);
  void        csm_util_setenv                         (const char *variable,
                                                       const char *value);
  
-+gboolean    csm_util_export_systemd_activation_environment (GError     **error);
-+
-+gboolean    csm_util_start_systemd_unit                  (const char  *unit,
-+                                                          GError     **error);
-+gboolean    csm_util_stop_systemd_unit                   (const char  *unit,
-+                                                          GError     **error);
++gboolean    csm_util_start_systemd_unit             (const char  *unit,
++                                                     const char  *mode,
++                                                     GError     **error);
++gboolean    csm_util_stop_systemd_unit              (const char  *unit,
++                                                     const char  *mode,
++                                                     GError     **error);
 +
  // main.c, exit mainloop
  void        csm_quit                                (void);
  
-diff --git a/cinnamon-session/main.c b/cinnamon-session/main.c
-index d71fcc1..5c96bd4 100644
---- a/cinnamon-session/main.c
-+++ b/cinnamon-session/main.c
-@@ -265,6 +265,13 @@ main (int argc, char **argv)
-         csm_util_export_activation_environment (NULL);
-         csm_util_export_user_environment (NULL);
- 
-+        if (!csm_util_export_systemd_activation_environment (NULL)) {
-+                g_warning ("main: failed to export environment to systemd --user; "
-+                           "some systemd-managed services may not start correctly");
-+        }
-+
-+        csm_util_start_systemd_unit ("cinnamon-session.target", NULL);
-+
-         {
-                 gchar *ibus_path;
- 
 diff --git a/data/meson.build b/data/meson.build
 index b158e66..8a6c35b 100644
 --- a/data/meson.build
@@ -292,64 +149,86 @@ index b158e66..8a6c35b 100644
 +
 +subdir('systemd/user')
 +
-diff --git a/data/systemd/user/cinnamon-session-pre.target b/data/systemd/user/cinnamon-session-pre.target
-new file mode 100644
-index 0000000..40e6e82
---- /dev/null
-+++ b/data/systemd/user/cinnamon-session-pre.target
-@@ -0,0 +1,6 @@
-+[Unit]
-+Description=Cinnamon pre-session services
-+Documentation=man:systemd.special(7)
-+BindsTo=graphical-session-pre.target
-+After=graphical-session-pre.target
-+CollectMode=inactive-or-failed
 diff --git a/data/systemd/user/cinnamon-session.target b/data/systemd/user/cinnamon-session.target
 new file mode 100644
-index 0000000..08b1607
+index 0000000..33e9e45
 --- /dev/null
 +++ b/data/systemd/user/cinnamon-session.target
-@@ -0,0 +1,10 @@
+@@ -0,0 +1,14 @@
 +[Unit]
 +Description=Cinnamon graphical session
 +Documentation=man:systemd.special(7)
++
 +Wants=graphical-session.target
++Before=graphical-session.target
++
 +Wants=graphical-session-pre.target
 +After=graphical-session-pre.target
-+After=graphical-session.target
++
 +PropagatesStopTo=graphical-session.target
 +PropagatesStopTo=graphical-session-pre.target
++
 +CollectMode=inactive-or-failed
 diff --git a/data/systemd/user/meson.build b/data/systemd/user/meson.build
 new file mode 100644
-index 0000000..394aaae
+index 0000000..15834e4
 --- /dev/null
 +++ b/data/systemd/user/meson.build
-@@ -0,0 +1,7 @@
+@@ -0,0 +1,8 @@
++if enable_systemd
 +install_data(
 +  [
 +    'cinnamon-session.target',
-+    'cinnamon-session-pre.target',
 +  ],
 +  install_dir: systemduserunitdir,
 +)
++endif
+diff --git a/debian/cinnamon-session.install b/debian/cinnamon-session.install
+index f9afa88..fdaef25 100644
+--- a/debian/cinnamon-session.install
++++ b/debian/cinnamon-session.install
+@@ -1,5 +1,6 @@
+ usr/bin/cinnamon-session*
+ usr/lib/*/cinnamon-session*
++usr/lib/systemd/user/cinnamon-session.target
+ usr/share/cinnamon-session
+ usr/share/glib-2.0/schemas/org.cinnamon.SessionManager.gschema.xml
+ usr/share/man/*/cinnamon-session*
 diff --git a/meson.build b/meson.build
-index a1ee4b3..a3bd48f 100644
+index a1ee4b3..aea9ac1 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -58,6 +58,15 @@ else
+@@ -58,6 +58,23 @@ else
  endif
  conf.set('HAVE_LOGIND', logind.found())
  
-+if libsystemdl.found()
-+  systemduserunitdir = libsystemdl.get_variable(
++systemd_opt = get_option('systemd')
++systemd_dep = dependency('libsystemd', required: systemd_opt.enabled())
++if systemd_dep.found()
++  systemduserunitdir = systemd_dep.get_variable(
 +    pkgconfig: 'systemduserunitdir',
-+    default_value: join_paths(get_option('prefix'), 'lib', 'systemd', 'user'),
++    default_value: join_paths(get_option('prefix'), 'lib', 'systemd', 'user')
 +  )
++  enable_systemd = true
 +else
++  enable_systemd = systemd_dep.found() and not systemd_opt.disabled()
 +  systemduserunitdir = join_paths(get_option('prefix'), 'lib', 'systemd', 'user')
 +endif
 +
++message('Systemd integration: ' + (enable_systemd ? 'enabled' : 'disabled'))
++message('Systemd user unit dir: ' + systemduserunitdir)
++
++
  if gio_unix.found() and libelogind.found()
    elogind = declare_dependency(dependencies: [ gio_unix, libelogind ])
  else
+diff --git a/meson_options.txt b/meson_options.txt
+index 4066751..410e872 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,3 +1,5 @@
+ option('frequent_warnings',  type: 'boolean', value: false)
+ option('ipv6',               type: 'boolean', value: true)
+ option('xtrans',             type: 'boolean', value: true)
++option('systemd',            type: 'feature', value: 'auto')
++

diff --git a/cinnamon-session.spec b/cinnamon-session.spec
index 371bc75..14ae7aa 100644
--- a/cinnamon-session.spec
+++ b/cinnamon-session.spec
@@ -3,12 +3,12 @@
 Summary: Cinnamon session manager
 Name:    cinnamon-session
 Version: 6.6.3
-Release: 2%{?dist}
+Release: 3%{?dist}
 # Automatically converted from old format: GPLv2+ and LGPLv2+ - review is highly recommended.
 License: GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+
 URL:     https://github.com/linuxmint/%{name}
 Source0: %url/archive/%{version}/%{name}-%{version}.tar.gz
-Patch0:  %url/pull/204.patch#/Add-graphical-session.patch
+Patch0:  %url/commit/e01c8c37f6bb5458cc8f38ad73e23d232e7f932a.patch#/Add-graphical-session.patch
 
 ExcludeArch: %{ix86}
 
@@ -78,6 +78,9 @@ the other core components and handles logout and saving the session.
 %{_userunitdir}/*.target
 
 %changelog
+* Tue Jun 16 2026 Leigh Scott <leigh123linux@gmail.com> - 6.6.3-3
+- Use commit for patch
+
 * Wed May 27 2026 Leigh Scott <leigh123linux@gmail.com> - 6.6.3-2
 - Add patch to run graphical-session target
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-16 19:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-16 19:24 [rpms/cinnamon-session] f44: Use commit for patch Leigh Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox