From 088f26cbb877e97320ab1cf9257fcfdc04546ce2 Mon Sep 17 00:00:00 2001 From: chris-010 <10660568+chris-010@users.noreply.github.com> Date: Mon, 17 Aug 2026 11:53:41 +0200 Subject: [PATCH] fix: ignore empty responses on the login screen Message::Auth is constructed in exactly one place, the .on_submit of the password input, and it forwards whatever the field holds to greetd. An empty field therefore sends PostAuthMessageResponse with response Some(""), PAM rejects it, and greetd tears the session down; the greeter then reconnects with a fresh CreateSession. Every stray Enter costs that round trip, and while it runs the user is looking at the authenticating spinner. Non-interactive auth messages (AuthMessageType::Info) are acknowledged separately with response None and never reach Message::Auth, so an empty Some can only come from the user submitting an empty field. This is the login-screen counterpart of the lock-screen fix in #509. The two do not overlap; that one guards Message::Submit in locker.rs. Drafted with AI assistance (Claude Code); the change was reviewed, built and tested by me as described. Signed-off-by: chris-010 <10660568+chris-010@users.noreply.github.com> --- src/greeter.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/greeter.rs b/src/greeter.rs index b53e4f4..6431496 100644 --- a/src/greeter.rs +++ b/src/greeter.rs @@ -1486,6 +1486,9 @@ impl cosmic::Application for App { } } Message::Auth(response) => { + if response.as_deref() == Some("") { + return Task::none(); + } self.common.error_opt = None; self.authenticating = true; self.send_request(Request::PostAuthMessageResponse { response });