egui-winit: Ctrl+V blocks the event loop ~25 s when the X11 clipboard owner doesn't respond
Describe the bug
On X11, when the CLIPBOARD selection owner stops responding (e.g. a hung or SIGSTOPped application still owns the clipboard), pressing Ctrl+V in an eframe app freezes the whole window — no input, no redraw — for about 25 seconds.
egui_winit::State::on_keyboard_input calls self.clipboard.get() synchronously on the UI thread when it sees the paste shortcut. arboard's X11 backend then waits up to LONG_TIMEOUT_DUR (4 s) for each text target it tries, so the total stall is several times that.
To Reproduce
- On an X11 session:
echo hello | xclip -selection clipboard -i & kill -STOP $(pgrep -n xclip)(the clipboard owner now never answers)- Run any eframe app (e.g. the
hello_worldexample), focus it and press Ctrl+V. - The window stops responding for ~25 s.
Expected behavior
The window stays responsive while the clipboard is being read; a paste that can't be read within a short time is dropped (or delivered later as Event::Paste).
Suggestions
- Read the clipboard off the UI thread (or with a short timeout) and deliver
Event::Pastewhen the read completes, or - let applications opt out of egui-winit's built-in clipboard handling on the paste shortcut, so they can read the clipboard asynchronously themselves.
Environment
- egui / egui-winit / eframe 0.36.1, arboard 3.6.1
- Linux (Fedora 44), X11 session (also reproduced under Xvfb)