From df3939b79dcdd3b475ac2edf76f3f631e94ced1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@redhat.com>
Date: Thu, 13 Feb 2025 15:22:07 +0100
Subject: [PATCH] Fix session button visibility after auth failures

Resolves: https://issues.redhat.com/browse/RHEL-4116
---
 ...-session-menu-button-when-in-IN_PROG.patch | 41 +++++++++++++++++++
 gnome-shell.spec                              |  7 +++-
 2 files changed, 47 insertions(+), 1 deletion(-)
 create mode 100644 0001-loginDialog-Show-session-menu-button-when-in-IN_PROG.patch

diff --git a/0001-loginDialog-Show-session-menu-button-when-in-IN_PROG.patch b/0001-loginDialog-Show-session-menu-button-when-in-IN_PROG.patch
new file mode 100644
index 0000000..e148009
--- /dev/null
+++ b/0001-loginDialog-Show-session-menu-button-when-in-IN_PROG.patch
@@ -0,0 +1,41 @@
+From 44868c705fe499bf6a0aeeef90192e54175b88cb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
+Date: Thu, 13 Feb 2025 14:11:04 +0100
+Subject: [PATCH] loginDialog: Show session menu button when in IN_PROGRESS
+ status
+
+Commit c8bb45b added a new IN_PROGRESS status that replaces FAILED
+while the user is still allowed to retry authentication.
+
+We need to account for it when updating the visibility of the
+session menu button, otherwise the button disappears after
+entering a wrong password.
+
+Fixes: c8bb45b41c ("gdm: Limit verification cancellations to be conform to allowed-failures")
+Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5784
+---
+ js/gdm/loginDialog.js | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
+index 1df5c5eed0..36ecfe444f 100644
+--- a/js/gdm/loginDialog.js
++++ b/js/gdm/loginDialog.js
+@@ -890,8 +890,12 @@ var LoginDialog = GObject.registerClass({
+     }
+ 
+     _shouldShowSessionMenuButton() {
+-        if (this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.VERIFYING &&
+-            this._authPrompt.verificationStatus != AuthPrompt.AuthPromptStatus.VERIFICATION_FAILED)
++        const visibleStatuses = [
++            AuthPrompt.AuthPromptStatus.VERIFYING,
++            AuthPrompt.AuthPromptStatus.VERIFICATION_FAILED,
++            AuthPrompt.AuthPromptStatus.VERIFICATION_IN_PROGRESS,
++        ];
++        if (!visibleStatuses.includes(this._authPrompt.verificationStatus))
+             return false;
+ 
+         if (this._user && this._user.is_loaded && this._user.is_logged_in())
+-- 
+2.48.1
+
diff --git a/gnome-shell.spec b/gnome-shell.spec
index 6558727..e820733 100644
--- a/gnome-shell.spec
+++ b/gnome-shell.spec
@@ -8,7 +8,7 @@
 
 Name:           gnome-shell
 Version:        40.10
-Release:        23%{?dist}
+Release:        24%{?dist}
 Summary:        Window management and application launching for GNOME
 
 License:        GPLv2+
@@ -34,6 +34,7 @@ Patch15: gdm-networking.patch
 Patch16: login-screen-extensions.patch
 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
 
 # Misc.
 Patch30: 0001-panel-add-an-icon-to-the-ActivitiesButton.patch
@@ -300,6 +301,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/evolution-calendar.de
 %endif
 
 %changelog
+* Thu Feb 13 2025 Florian Müllner <fmuellner@redhat.com> - 40.10-24
+- Fix session button visibility after auth failure
+  Resolves: RHEL-4116
+
 * Tue Nov 19 2024 Florian Müllner <fmuellner@redhat.com> - 40.10-23
 - Fix leaked signal connection
   Related: RHEL-22692