Skip to content

Conversation

@mtwebster
Copy link
Member

This allows cinnamon to be restarted under the correct login session to prevent blocking of polkit authentication.

@mtwebster mtwebster requested a review from Copilot May 13, 2025 23:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to restart the cinnamon-launcher on-demand in order to ensure cinnamon-session runs in the correct login session, which helps prevent polkit authentication issues. Key changes include adding new XML properties and methods for session and restart operations, introducing a new API to retrieve the login session ID in various system backends, and wiring a new DBus method to trigger the restart.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cinnamon-session/org.gnome.SessionManager.xml Added SessionId property and RestartCinnamonLauncher method
cinnamon-session/csm-systemd.c Implemented csm_systemd_get_login_session_id
cinnamon-session/csm-system.h Extended system interface for login session ID retrieval
cinnamon-session/csm-system.c Exposed login session ID via the system interface
cinnamon-session/csm-session-fill.c Exported login session ID post session activation
cinnamon-session/csm-manager.h Declared export function for login session ID
cinnamon-session/csm-manager.c Added restart_cinnamon_launcher logic and DBus handler implementation
cinnamon-session/csm-consolekit.c Provided stub implementation for consolekit login session ID
cinnamon-session/csm-app.c Modified app restart behavior to only trigger via DBus if cinnamon.desktop

ret = sd_pid_get_session (getpid (), &pid_session);

if (ret < 0) {
g_printerr ("can't get logion session id for cinnamon-session. errno: %d\n", -ret);
Copy link

Copilot AI May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in error message: 'logion' should be corrected to 'login'.

Suggested change
g_printerr ("can't get logion session id for cinnamon-session. errno: %d\n", -ret);
g_printerr ("can't get login session id for cinnamon-session. errno: %d\n", -ret);

Copilot uses AI. Check for mistakes.
on-demand.

This allows cinnamon to be restarted under the correct login
session to prevent blocking of polkit authentication.
@mtwebster mtwebster force-pushed the restart-cinnamon-launcher branch from d45db1b to 78ec351 Compare May 13, 2025 23:28
mtwebster added a commit to linuxmint/cinnamon that referenced this pull request May 13, 2025
correct login session when registering.

Compare Cinnamon's session id with cinnamon-session's (which
should never change), and have cinnamon-session restart us if
there is a mismatch.

Ref: #12669, #12728.

See: linuxmint/cinnamon-session#184.
@mtwebster mtwebster marked this pull request as draft May 14, 2025 01:08
mtwebster added a commit to linuxmint/cinnamon that referenced this pull request May 21, 2025
correct login session when registering.

Compare Cinnamon's session id with cinnamon-session's (which
should never change), and have cinnamon-session restart us if
there is a mismatch.

Ref: #12669, #12728.

See: linuxmint/cinnamon-session#184.
mtwebster added a commit to linuxmint/cinnamon that referenced this pull request May 21, 2025
correct login session when registering.

Compare Cinnamon's session id with cinnamon-session's (which
should never change), and have cinnamon-session restart us if
there is a mismatch.

Ref: #12669, #12728.

See: linuxmint/cinnamon-session#184.
@mtwebster mtwebster marked this pull request as ready for review May 21, 2025 13:34
@mtwebster mtwebster merged commit f72fbe1 into master May 21, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant