Embedded window sometimes fails to receive Focus event
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start by tracing the X11 focus event path in winit and how it updates the window's focused state; the report does not identify a source file or failing test. Reproduce with Alacritty 0.13.2 embedded in tabbed on X11, comparing normal and failed startups with --print-events. Done when the intermittent missing Focused(true) event is understood and a regression test covers the fix.
Written by the indexing model from the issue text.
Description
Description
Hello!
I'm using Alacrity inside tabbed 0.7. tabbed is a frame around other windows and adds tab management. It starts with tabbed -c k alacritty --embed.
This usually works fine, but one in five startups or so, Alacritty does not have keyboard focus. It doesn't receive input and Alacritty's cursor indicates it not having focus. Despite the fact that the tabbed window definitely has focus.
- Clicking inside alacritty with the cursor does not help.
- Focusing Alacritty with
xdotool windowfocus <id>does not help (and the focus attempt is not logged with--print-events) - Focusing the tabbed frame itself (with
xdotool) helps - Focusing another window first and then moving focus back to tabbed also helps.
Normal startup logged with --print-events:
[0.139547002s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(234881029)), event: Ime(Enabled) }
[0.139798660s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(234881029)), event: Focused(false) }
[0.140879751s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(234881029)), event: Focused(true) }
Bugged startup:
[0.141411534s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(234881029)), event: Ime(Enabled) }
[0.141826159s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(234881029)), event: Focused(false) }
It would appear that there is a race condition or something inside Alacritty/winit that prevents it from receiving the Focused(true) event, and thus the internal state disagrees with the actual state, breaking keyboard focus.
OS and window mananger
Ubuntu Linux 24.04.5 LTS, X11, Xfwm4-4.18.0
Winit version
winit-0.29.15 inside Alacritty 0.13.2
- Dominant language
- Rust
- Stars
- 6.2k
- Forks
- 1.5k
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 16
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-windowing/winit
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rust-windowing/winit#4804 · 1 reaction ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rust-windowing/winit#4731 · 1 comment ·
Maintainers usually reply within 3 days
-
macOS: Dictation (voice input) silently drops text — selectedRange returns NSNotFoundPossibly taken @lucasmerlin claimed this 23 days ago. OpenB - bug DS - appkit
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
rust-windowing/winit#4666 · 1 comment ·
Maintainers usually reply within 3 days
-
DS - x11
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rust-windowing/winit#4479 · 5 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
B - bug DS - wayland
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-windowing/winit#4810 ·
Maintainers usually reply within 3 days
All issues in rust-windowing/winit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
storytold/craft-libs#471 ·
Maintainers usually reply within 1 day
-
enhancement parity priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
storytold/gridcraft#3053 · 1 comment ·
Maintainers usually reply within 2 days
-
bug file-compat parity priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
i18n multiple issues parity priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
storytold/vectorcraft#4943 · 3 comments ·
Maintainers usually reply within 1 day