import CS gnome-shell-40.10-31.el9_7

This commit is contained in:
eabdullin 2025-11-11 18:06:38 +00:00
parent 609d29d080
commit ab79f77039
3 changed files with 581 additions and 6 deletions

View File

@ -0,0 +1,433 @@
From fd6f5b9834ffbd417b0543ac89ae0f8aeb67ff04 Mon Sep 17 00:00:00 2001
From: Joan Torres <joantolo@redhat.com>
Date: Thu, 8 May 2025 12:51:58 +0200
Subject: [PATCH 1/4] loginManager: Add session-removed signal and getSession
method
These changes will be used by the next commit when displaying a
conflicting session dialog.
session-removed signal will be used to close the conflicting session dialog
if it's not needed anymore.
getSession method will be used when a session is opened, to check if
there's already a conflicting opened session.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3134>
---
js/misc/loginManager.js | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js
index 55e928986..3a91a4e8c 100644
--- a/js/misc/loginManager.js
+++ b/js/misc/loginManager.js
@@ -97,6 +97,8 @@ var LoginManagerSystemd = class {
'/org/freedesktop/login1/user/self');
this._proxy.connectSignal('PrepareForSleep',
this._prepareForSleep.bind(this));
+ this._proxy.connectSignal('SessionRemoved',
+ this._sessionRemoved.bind(this));
}
getCurrentSessionProxy(callback) {
@@ -184,6 +186,10 @@ var LoginManagerSystemd = class {
});
}
+ getSession(objectPath) {
+ return new SystemdLoginSession(Gio.DBus.system, 'org.freedesktop.login1', objectPath);
+ }
+
suspend() {
this._proxy.SuspendRemote(true);
}
@@ -206,6 +212,10 @@ var LoginManagerSystemd = class {
_prepareForSleep(proxy, sender, [aboutToSuspend]) {
this.emit('prepare-for-sleep', aboutToSuspend);
}
+
+ _sessionRemoved(proxy, sender, [sessionId]) {
+ this.emit('session-removed', sessionId);
+ }
};
Signals.addSignalMethods(LoginManagerSystemd.prototype);
@@ -231,6 +241,10 @@ var LoginManagerDummy = class {
asyncCallback([]);
}
+ getSession(_objectPath) {
+ return null;
+ }
+
suspend() {
this.emit('prepare-for-sleep', true);
this.emit('prepare-for-sleep', false);
--
2.49.0
From f7d21a1ed99758c5f855adf9e0404a805f0fe497 Mon Sep 17 00:00:00 2001
From: Joan Torres <joantolo@redhat.com>
Date: Thu, 8 May 2025 13:10:19 +0200
Subject: [PATCH 2/4] loginDialog: Add ConflictingSessionDialog
This dialog will be used by the next commit when a session is being opened but
there's already a conflicting session opened.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3134>
---
.../org.freedesktop.login1.Session.xml | 1 +
js/gdm/loginDialog.js | 64 +++++++++++++++++++
2 files changed, 65 insertions(+)
diff --git a/data/dbus-interfaces/org.freedesktop.login1.Session.xml b/data/dbus-interfaces/org.freedesktop.login1.Session.xml
index 6fab81794..ecab4bbaa 100644
--- a/data/dbus-interfaces/org.freedesktop.login1.Session.xml
+++ b/data/dbus-interfaces/org.freedesktop.login1.Session.xml
@@ -5,6 +5,7 @@
<property name="Active" type="b" access="read"/>
<property name="Class" type="s" access="read"/>
<property name="Id" type="s" access="read"/>
+ <property name="Name" type="s" access="read"/>
<property name="Remote" type="b" access="read"/>
<property name="Type" type="s" access="read"/>
<property name="State" type="s" access="read"/>
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 241721ff7..674ff24a5 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -28,6 +28,7 @@ const GdmUtil = imports.gdm.util;
const Layout = imports.ui.layout;
const LoginManager = imports.misc.loginManager;
const Main = imports.ui.main;
+const ModalDialog = imports.ui.modalDialog;
const PopupMenu = imports.ui.popupMenu;
const Realmd = imports.gdm.realmd;
const UserWidget = imports.ui.userWidget;
@@ -400,6 +401,69 @@ var SessionMenuButton = GObject.registerClass({
}
});
+var ConflictingSessionDialog = GObject.registerClass({
+ Signals: {
+ 'cancel': {},
+ 'force-stop': {},
+ },
+}, class ConflictingSessionDialog extends ModalDialog.ModalDialog {
+ _init(conflictingSession) {
+ super._init();
+
+ const userName = conflictingSession.Name;
+ let bannerText;
+ /* Translators: is running for <username> */
+ bannerText = _('Login is not possible because a session is already running for %s. To login, you must log out from the session or force stop it.').format(userName);
+
+ let textLayout = new St.BoxLayout({
+ vertical: true,
+ x_expand: true,
+ style: 'spacing: 20px;',
+ });
+
+ let title = new St.Label({
+ text: _('Session Already Running'),
+ style: 'text-align: center;'
+ + 'font-size: 18pt;'
+ + 'font-weight: 800;'
+ + 'margin-bottom: 5px;' });
+
+ let banner = new St.Label({
+ text: bannerText,
+ style: 'text-align: center',
+ });
+ banner.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
+ banner.clutter_text.line_wrap = true;
+
+ let warningBanner = new St.Label({
+ text: _('Force stopping will quit any running apps and processes, and could result in data loss'),
+ style: 'text-align: center; color: #f57900;',
+ });
+ warningBanner.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
+ warningBanner.clutter_text.line_wrap = true;
+
+ textLayout.add_child(title);
+ textLayout.add_child(banner);
+ textLayout.add_child(warningBanner);
+ this.contentLayout.add_child(textLayout);
+
+ this.addButton({
+ label: _('Cancel'),
+ action: () => {
+ this.emit('cancel');
+ },
+ key: Clutter.KEY_Escape,
+ default: true,
+ });
+ this.addButton({
+ label: _('Force Stop'),
+ action: () => {
+ this.emit('force-stop');
+ },
+ });
+ }
+});
+
var LoginDialog = GObject.registerClass({
Signals: {
'failed': {},
--
2.49.0
From d849667b91d252cc9e029e8e1b2aaf4045e3890c Mon Sep 17 00:00:00 2001
From: Joan Torres <joantolo@redhat.com>
Date: Thu, 8 May 2025 13:17:40 +0200
Subject: [PATCH 3/4] loginDialog: On login, allow logout a conflicting session
When opening a session, find if there's already a session opened for the
same user with the help of Loginmanager.
When it's found, display the conflicting session dialog.
The logout dialog allows shutting down the conflicting session using the
greeter dbus method "StopConflictingSession".
If the dialog is already opened and the conflicting session has been
closed on its side, the new session will start.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3134>
---
.../org.freedesktop.login1.Session.xml | 1 +
js/gdm/loginDialog.js | 95 ++++++++++++++++++-
2 files changed, 92 insertions(+), 4 deletions(-)
diff --git a/data/dbus-interfaces/org.freedesktop.login1.Session.xml b/data/dbus-interfaces/org.freedesktop.login1.Session.xml
index ecab4bb..16dee1c 100644
--- a/data/dbus-interfaces/org.freedesktop.login1.Session.xml
+++ b/data/dbus-interfaces/org.freedesktop.login1.Session.xml
@@ -6,6 +6,7 @@
<property name="Class" type="s" access="read"/>
<property name="Id" type="s" access="read"/>
<property name="Name" type="s" access="read"/>
+ <property name="User" type="(uo)" access="read"/>
<property name="Remote" type="b" access="read"/>
<property name="Type" type="s" access="read"/>
<property name="State" type="s" access="read"/>
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 6cf8133..e3dac97 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -916,8 +916,14 @@ var LoginDialog = GObject.registerClass({
this._defaultSessionChangedId = this._greeter.connect('default-session-name-changed',
this._onDefaultSessionChanged.bind(this));
- this._sessionOpenedId = this._greeter.connect('session-opened',
- this._onSessionOpened.bind(this));
+ // Connect to the new signal if available, otherwise fall back to the old signal
+ let signalId = GObject.signal_lookup('session-opened-with-session-id', this._greeter.constructor.$gtype);
+ if (signalId !== 0)
+ this._sessionOpenedId = this._greeter.connect('session-opened-with-session-id',
+ this._onSessionOpenedWithSessionId.bind(this));
+ else
+ this._sessionOpenedId = this._greeter.connect('session-opened',
+ this._onSessionOpened.bind(this));
this._timedLoginRequestedId = this._greeter.connect('timed-login-requested',
this._onTimedLoginRequested.bind(this));
}
@@ -1055,6 +1061,28 @@ var LoginDialog = GObject.registerClass({
});
}
+ _showConflictingSessionDialog(serviceName, conflictingSession) {
+ let conflictingSessionDialog = new ConflictingSessionDialog(conflictingSession);
+
+ conflictingSessionDialog.connect('cancel', () => {
+ this._authPrompt.reset();
+ conflictingSessionDialog.close();
+ });
+ conflictingSessionDialog.connect('force-stop', () => {
+ this._greeter.call_stop_conflicting_session_sync(null);
+ });
+
+ const loginManager = LoginManager.getLoginManager();
+ loginManager.connect('session-removed', (lm, sessionId) => {
+ if (sessionId === conflictingSession.Id) {
+ conflictingSessionDialog.close();
+ this._authPrompt.finish(() => this._startSession(serviceName));
+ }
+ }, conflictingSessionDialog);
+
+ conflictingSessionDialog.open();
+ }
+
_startSession(serviceName) {
this._bindOpacity();
this.ease({
@@ -1068,8 +1096,67 @@ var LoginDialog = GObject.registerClass({
});
}
- _onSessionOpened(client, serviceName) {
- this._authPrompt.finish(() => this._startSession(serviceName));
+ _listSessions() {
+ const loginManager = LoginManager.getLoginManager();
+ return new Promise(resolve => {
+ loginManager.listSessions(sessions => {
+ resolve(sessions);
+ });
+ });
+ }
+
+ async _findConflictingSession(startingSessionId) {
+ const loginManager = LoginManager.getLoginManager();
+ let sessions = await this._listSessions();
+ sessions = sessions.map(([, , , , path]) => loginManager.getSession(path));
+ const startingSession = sessions.find(s => s.Id === startingSessionId);
+ for (const session of sessions) {
+ if (startingSession.Id === session.Id)
+ continue;
+
+ if (startingSession.User[0] !== session.User[0]) // this is the uid
+ continue;
+
+ if (startingSession.Type === 'x11' && session.Type === 'x11' &&
+ startingSession.Remote && session.Remote)
+ continue;
+
+ if (session.Type !== 'wayland' && session.Type !== 'x11')
+ continue;
+
+ if (session.State !== 'active' && session.State !== 'online')
+ continue;
+
+ return session;
+ }
+
+ return null;
+ }
+
+ async _onSessionOpenedWithSessionId(client, serviceName, sessionId) {
+ try {
+ if (sessionId) {
+ const conflictingSession = await this._findConflictingSession(sessionId);
+ if (conflictingSession) {
+ this._showConflictingSessionDialog(serviceName, conflictingSession);
+ return;
+ }
+ }
+
+ this._authPrompt.finish(() => this._startSession(serviceName));
+ } catch (error) {
+ logError(error, `Failed to start session '${sessionId}'`);
+ this._authPrompt.reset();
+ }
+ }
+
+ async _onSessionOpened(client, serviceName, sessionId) {
+ try {
+ this._authPrompt.finish(() => this._startSession(serviceName));
+ } catch (error) {
+ logError(error, `Failed to start session '${sessionId}'`);
+ this._authPrompt.reset();
+ }
}
_waitForItemForUser(userName) {
--
2.51.0
From b5dc399c0cdbecad7bd91bbae2287154e934981a Mon Sep 17 00:00:00 2001
From: Joan Torres <joantolo@redhat.com>
Date: Thu, 8 May 2025 13:22:30 +0200
Subject: [PATCH 4/4] loginDialog: Close conflicting session dialog after 60
secs
When the stop conflicting session dialog is opened, use a timeout of 60
seconds to close it.
This is an attempt to keep security in the situation where the user leaves,
the system is left unsupervised and the dialog is opened; allowing anyone
to stop the old session and start a new session.
When the dialog is closed by the timeout, a notification apperars informing
about that.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3134>
---
js/gdm/loginDialog.js | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 25b86880d..83a3bb09d 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -28,6 +28,7 @@ const GdmUtil = imports.gdm.util;
const Layout = imports.ui.layout;
const LoginManager = imports.misc.loginManager;
const Main = imports.ui.main;
+const MessageTray = imports.ui.messageTray;
const ModalDialog = imports.ui.modalDialog;
const PopupMenu = imports.ui.popupMenu;
const Realmd = imports.gdm.realmd;
@@ -36,6 +37,7 @@ const UserWidget = imports.ui.userWidget;
const _FADE_ANIMATION_TIME = 250;
const _SCROLL_ANIMATION_TIME = 500;
const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0;
+const _CONFLICTING_SESSION_DIALOG_TIMEOUT = 60;
var UserListItem = GObject.registerClass({
Signals: { 'activate': {} },
@@ -1044,6 +1046,22 @@ var LoginDialog = GObject.registerClass({
});
}
+ _notifyConflictingSessionDialogClosed() {
+ const source = new MessageTray.SystemNotificationSource();
+ Main.messageTray.add(source);
+
+ this._conflictingSessionNotification = new MessageTray.Notification(source,
+ _('Login Attempt Timed Out'),
+ _('Login took too long, please try again'));
+ this._conflictingSessionNotification.setUrgency(MessageTray.Urgency.CRITICAL);
+ this._conflictingSessionNotification.setTransient(true);
+ this._conflictingSessionNotification.connect('destroy', () => {
+ this._conflictingSessionNotification = null;
+ });
+
+ source.showNotification(this._conflictingSessionNotification);
+ }
+
_showConflictingSessionDialog(serviceName, conflictingSession) {
let conflictingSessionDialog = new ConflictingSessionDialog(conflictingSession);
@@ -1063,6 +1081,17 @@ var LoginDialog = GObject.registerClass({
}
}, conflictingSessionDialog);
+ const closeDialogTimeoutId = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, _CONFLICTING_SESSION_DIALOG_TIMEOUT, () => {
+ this._notifyConflictingSessionDialogClosed();
+ conflictingSessionDialog.close();
+ this._authPrompt.reset();
+ return GLib.SOURCE_REMOVE;
+ });
+
+ conflictingSessionDialog.connect('closed', () => {
+ GLib.source_remove(closeDialogTimeoutId);
+ });
+
conflictingSessionDialog.open();
}
@@ -1318,6 +1347,9 @@ var LoginDialog = GObject.registerClass({
this._updateCancelButton();
+ if (this._conflictingSessionNotification)
+ this._conflictingSessionNotification.destroy();
+
let batch = new Batch.ConcurrentBatch(this, [GdmUtil.cloneAndFadeOutActor(this._userSelectionBox),
this._beginVerificationForItem(activatedItem)]);
batch.run();
--
2.49.0

View File

@ -0,0 +1,118 @@
From 1db8edbaf877a9ba8b972bd64871767866b3c9af Mon Sep 17 00:00:00 2001
From: Joan Torres Lopez <joantolo@redhat.com>
Date: Wed, 22 Oct 2025 13:32:15 +0200
Subject: [PATCH 1/2] authPrompt: Connect disable-show-password key with
password entry
---
js/gdm/authPrompt.js | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index e961f39..b6a323f 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported AuthPrompt */
-const { Clutter, GLib, GObject, Meta, Pango, Shell, St } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Meta, Pango, Shell, St } = imports.gi;
const Animation = imports.ui.animation;
const AuthList = imports.gdm.authList;
@@ -20,6 +20,9 @@ var DEFAULT_BUTTON_WELL_ANIMATION_TIME = 300;
var MESSAGE_FADE_OUT_ANIMATION_TIME = 500;
+const LOCKDOWN_SCHEMA = 'org.gnome.desktop.lockdown';
+const DISABLE_SHOW_PASSWORD_KEY = 'disable-show-password';
+
var AuthPromptMode = {
UNLOCK_ONLY: 0,
UNLOCK_OR_LOG_IN: 1,
@@ -198,6 +201,11 @@ var AuthPrompt = GObject.registerClass({
this._mainBox.add_child(this._entry);
this._entry.grab_key_focus();
+ this._lockdownSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
+ this._lockdownSettings.connect(`changed::${DISABLE_SHOW_PASSWORD_KEY}`,
+ this._updateShowPasswordIcon.bind(this));
+ this._updateShowPasswordIcon();
+
this._timedLoginIndicator = new St.Bin({
style_class: 'login-dialog-timed-login-indicator',
scale_x: 0,
@@ -233,6 +241,13 @@ var AuthPrompt = GObject.registerClass({
this._defaultButtonWell.add_child(this._spinner);
}
+ _updateShowPasswordIcon() {
+ try {
+ const disableShowPassword = this._lockdownSettings.get_boolean(DISABLE_SHOW_PASSWORD_KEY);
+ this._passwordEntry.set_show_peek_icon(!disableShowPassword);
+ } catch (e) {}
+ }
+
showTimedLoginIndicator(time) {
let hold = new Batch.Hold();
--
2.51.0
From e308153f0d3cef060d38ffba0d781c4a53c6921a Mon Sep 17 00:00:00 2001
From: Joan Torres Lopez <joantolo@redhat.com>
Date: Wed, 22 Oct 2025 13:42:01 +0200
Subject: [PATCH 2/2] unlockDialog: Do not reset the auth prompt on every tap
Currently we have a tap event tracker that causes that every time a tap
happens in the lock screen, we reset the auth prompt and this can be
particularly annoying at least in three cases:
1. Just clicking everywhere in the screen may lead the unlock entry
content to be cleared
2. Clicking in the screen while an authentication is in progress,
cancels it
3. This may break a multi-factor authentication method, as a single
click may lead previous steps to be cancelled
So, while resetting the auth prompt is important when we're about to
show it, it's not something we want to do while an authentication has
started.
As per this also do not touch the auth prompt sensitivity unless we're
in an idle phase, or we may end up overriding the auth prompt state,
leading for example to a text entry being editable while we're verifying
the secret
Fixes: 37e55df29865dac13656116efdd7abec8056dea9
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3852>
---
js/ui/unlockDialog.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js
index 00e3eef..169043b 100644
--- a/js/ui/unlockDialog.js
+++ b/js/ui/unlockDialog.js
@@ -698,8 +698,15 @@ var UnlockDialog = GObject.registerClass({
this._promptBox.add_child(this._authPrompt);
}
- this._authPrompt.reset();
- this._authPrompt.updateSensitivity(true);
+ const {verificationStatus} = this._authPrompt;
+ switch (verificationStatus) {
+ case AuthPrompt.AuthPromptStatus.NOT_VERIFYING:
+ case AuthPrompt.AuthPromptStatus.VERIFICATION_CANCELLED:
+ case AuthPrompt.AuthPromptStatus.VERIFICATION_FAILED:
+ this._authPrompt.reset();
+ this._authPrompt.updateSensitivity(
+ verificationStatus === AuthPrompt.AuthPromptStatus.NOT_VERIFYING);
+ }
}
_maybeDestroyAuthPrompt() {
--
2.51.0

View File

@ -8,7 +8,7 @@
Name: gnome-shell
Version: 40.10
Release: 26%{?dist}
Release: 31%{?dist}
Summary: Window management and application launching for GNOME
License: GPLv2+
@ -36,6 +36,7 @@ Patch17: fix-resetting-auth-prompt.patch
Patch18: 0001-authPrompt-Disregard-smartcard-status-changes-events.patch
Patch19: 0001-loginDialog-Show-session-menu-button-when-in-IN_PROG.patch
Patch20: 0001-systemActions-Optionally-allow-restart-shutdown-on-l.patch
Patch21: 0001-authPrompt-Connect-disable-show-password-key-with-pa.patch
# Misc.
Patch30: 0001-panel-add-an-icon-to-the-ActivitiesButton.patch
@ -74,6 +75,7 @@ Patch62: fix-inhibit-shortcut-permission.patch
Patch63: 0001-shell-window-tracker-Help-mutter-finding-app-info-s-.patch
Patch64: 0001-dnd-Don-t-leak-a-signal-connection.patch
Patch65: 0001-st-theme-Reuse-stylesheets-if-possible.patch
Patch66: 0001-Support-conflicting-session-dialog.patch
%define eds_version 3.33.1
%define gnome_desktop_version 3.35.91
@ -303,13 +305,35 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/evolution-calendar.de
%endif
%changelog
* Wed Jul 16 2025 Joan Torres <joantolo@redhat.com> - 40.10-26
- Allow restart/shutdown on lock screen
Resolves: RHEL-107253
* Wed Oct 22 2025 Joan Torres <joantolo@redhat.com> - 40.10-31
- Don't fail if disable-show-password doesn't exist
Related: RHEL-109190
* Mon May 19 2025 Florian Müllner <fmuellner@redhat.com> - 40.10-25
* Thu Oct 2 2025 Joan Torres <joantolo@redhat.com> - 40.10-30
- Fix regression on multiple remote sessions and same user
Also, add missing fix to keep API/ABI compatibility on GDM greeter proxy.
Resolves: RHEL-109190
* Tue Oct 21 2025 Joan Torres <joantolo@redhat.com> - 40.10-29
- Allow disabling showing password on login/unlock screens
Resolves: RHEL-123139
* Wed Jul 16 2025 Joan Torres <joantolo@redhat.com> - 40.10-28
- Allow restart/shutdown on lock screen
Resolves: RHEL-103984
* Thu Jun 19 2025 Joan Torres <joantolo@redhat.com> - 40.10-27
- session-opened signature is reverted to keep ABI compatibility,
use session-opened-with-session-id instead
Related: RHEL-92307
* Fri May 09 2025 Joan Torres <joantolo@redhat.com> - 40.10-26
- Support conflicting session dialog
Resolves: RHEL-92307
* Mon May 05 2025 Florian Müllner <fmuellner@redhat.com> - 40.10-25
- Fix refount issue in stylesheet tracking
Resolves: RHEL-92415
Resolves: RHEL-69401
* Thu Feb 13 2025 Florian Müllner <fmuellner@redhat.com> - 40.10-24
- Fix session button visibility after auth failure