From d051dbb278843393733a6f988e6cc9a222df94cf Mon Sep 17 00:00:00 2001 From: dijunkun Date: Mon, 2 Nov 2026 03:03:53 +0800 Subject: [PATCH] [fix] avoid X11 None macro collision in credential recovery --- apps/desktop/src/gui/application/gui_application.cpp | 2 +- apps/desktop/src/gui/runtime/gui_runtime.cpp | 2 +- apps/desktop/src/gui/runtime/runtime_state.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/gui/application/gui_application.cpp b/apps/desktop/src/gui/application/gui_application.cpp index 554394f4..f3f3b85a 100644 --- a/apps/desktop/src/gui/application/gui_application.cpp +++ b/apps/desktop/src/gui/application/gui_application.cpp @@ -3113,7 +3113,7 @@ void GuiApplication::HandleCredentialRecovery() { CredentialRecoveryAction action; { std::lock_guard lock(password_change_mutex_); - action = std::exchange(credential_recovery_action_, CredentialRecoveryAction::None); + action = std::exchange(credential_recovery_action_, CredentialRecoveryAction::Idle); if (action == CredentialRecoveryAction::RetryActive) { credential_recovery_attempt_pending_ = false; } diff --git a/apps/desktop/src/gui/runtime/gui_runtime.cpp b/apps/desktop/src/gui/runtime/gui_runtime.cpp index 3b3250ea..2c5cf75b 100644 --- a/apps/desktop/src/gui/runtime/gui_runtime.cpp +++ b/apps/desktop/src/gui/runtime/gui_runtime.cpp @@ -190,7 +190,7 @@ int GuiRuntime::CreateConnectionPeer() { if (pending_identity.empty()) { credential_recovery_in_progress_ = false; credential_recovery_attempt_pending_ = false; - credential_recovery_action_ = CredentialRecoveryAction::None; + credential_recovery_action_ = CredentialRecoveryAction::Idle; } else if (!credential_recovery_in_progress_) { credential_recovery_in_progress_ = true; credential_recovery_attempt_pending_ = true; diff --git a/apps/desktop/src/gui/runtime/runtime_state.h b/apps/desktop/src/gui/runtime/runtime_state.h index 6a731fe8..d992800f 100644 --- a/apps/desktop/src/gui/runtime/runtime_state.h +++ b/apps/desktop/src/gui/runtime/runtime_state.h @@ -168,7 +168,7 @@ struct UserSettingsState { struct PasswordChangeState { enum class CredentialRecoveryAction { - None, RetryActive, PromotePending, ClearPending, ResumePending + Idle, RetryActive, PromotePending, ClearPending, ResumePending }; std::mutex password_change_mutex_; uint64_t next_password_change_request_id_ = 0; @@ -183,7 +183,7 @@ struct PasswordChangeState { std::string password_change_error_; bool credential_recovery_in_progress_ = false; bool credential_recovery_attempt_pending_ = false; - CredentialRecoveryAction credential_recovery_action_ = CredentialRecoveryAction::None; + CredentialRecoveryAction credential_recovery_action_ = CredentialRecoveryAction::Idle; }; struct ConnectionState {