From d319489479c371b15e6419d470551dae5d647396 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Fri, 19 Jan 2024 15:48:45 +0100 Subject: [PATCH] Fix deadlock during text selection --- crates/egui/src/text_selection/label_text_selection.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/egui/src/text_selection/label_text_selection.rs b/crates/egui/src/text_selection/label_text_selection.rs index 47604c1f21a..b62f34715e8 100644 --- a/crates/egui/src/text_selection/label_text_selection.rs +++ b/crates/egui/src/text_selection/label_text_selection.rs @@ -116,6 +116,7 @@ fn process_selection_key_events( cursor_range: &mut CursorRange, ) { let mut copy_text = None; + let os = ctx.os(); ctx.input(|i| { // NOTE: we have a lock on ui/ctx here, @@ -139,7 +140,7 @@ fn process_selection_key_events( } event => { - cursor_range.on_event(ctx.os(), event, galley, widget_id); + cursor_range.on_event(os, event, galley, widget_id); } } }