From 00c4fce31e2a9946c34fe52218ca319b7dedbc96 Mon Sep 17 00:00:00 2001 From: aiongg Date: Wed, 25 Nov 2026 07:23:43 +0000 Subject: [PATCH] Close the drop popup on the window's Escape --- crates/ui-egui/src/export_templates.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/export_templates.rs b/crates/ui-egui/src/export_templates.rs index beaf660f..7fd10cc4 100644 --- a/crates/ui-egui/src/export_templates.rs +++ b/crates/ui-egui/src/export_templates.rs @@ -1474,8 +1474,10 @@ fn source_channel_popup(ui: &Ui, pending: &mut Option, maps: &mut [ } } }); - // The app can consume Escape before the popup sees it, so read the raw event - let escaped = ui.input(|input| input.raw.events.iter().any(|event| matches!(event, egui::Event::Key { key: egui::Key::Escape, pressed: true, .. }))); + // The app's shortcuts can consume Escape before the popup sees it, so read the raw event too; the runtime keeps an + // Escape nothing of TextureCraft's has focus for as the window's cancel, which the framework reads + let escaped = crate::framework::escape_pressed(ui.ctx()) + || ui.input(|input| input.raw.events.iter().any(|event| matches!(event, egui::Event::Key { key: egui::Key::Escape, pressed: true, .. }))); if picked.is_some() || escaped || shown.is_none_or(|menu| menu.response.should_close()) { *pending = None; }