From 17211dcb65e8aa9542eb1cec5aceb4f3fd70bcea Mon Sep 17 00:00:00 2001 From: mbi Date: Sun, 11 Oct 2026 12:00:07 +0300 Subject: [PATCH] Fix Paste button deadlock in ribbon popup --- crates/ui-egui/src/ribbon.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/ribbon.rs b/crates/ui-egui/src/ribbon.rs index 264479a..8dc1071 100644 --- a/crates/ui-egui/src/ribbon.rs +++ b/crates/ui-egui/src/ribbon.rs @@ -332,10 +332,13 @@ fn home(app: &mut SheetApp, ui: &mut Ui) { // Keep a keyboard-opened menu anchored to the button when a pointer click // cancels keytips, so its items remain in place and can still be clicked. let anchor_id = paste.id.with("keytip_anchor"); + // Query response state before taking the egui context write lock. + // Calling secondary_clicked() inside data_mut can deadlock. + let paste_secondary_clicked = paste.secondary_clicked(); let anchored = ui.ctx().data_mut(|data| { let anchored = if paste_keys { true - } else if paste.secondary_clicked() { + } else if paste_secondary_clicked { false } else { data.get_temp::(anchor_id).unwrap_or(false)