Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard focus/keyboard event inconsistancy #2331

Closed
wmww opened this issue Feb 17, 2022 · 4 comments · Fixed by #2359 or #2423
Closed

Keyboard focus/keyboard event inconsistancy #2331

wmww opened this issue Feb 17, 2022 · 4 comments · Fixed by #2359 or #2423

Comments

@wmww
Copy link
Contributor

wmww commented Feb 17, 2022

#2245 we get

Attempt to send keyboard event to wl_surface@# even though it was not given keyboard focus

If Mir sends the Wayland frontend keyboard events for a surface that does not have keyboard focus. The problem is there is no synchronization between switching keyboard focus and sending input events, so events sent to the wrong surface could intermittently slip through (this has not been observed in the wild AFAIK). We should either restore the old behavior, or somehow ensure events arrive correctly.

@wmww wmww changed the title Keyboard focus/keyboard event potential inconsistancy Keyboard focus/keyboard event inconsistancy Feb 23, 2022
@wmww
Copy link
Contributor Author

wmww commented Feb 23, 2022

This is happening when opening weston-terminal. Repro:

  • From any terminal, run weston-terminal by pressing enter
  • Occasionally, Mir will crash

This was referenced Feb 23, 2022
@wmww
Copy link
Contributor Author

wmww commented Feb 23, 2022

Note that #2330 may have introduced this in practice or made it more common since it rearranged timing and order of the relevant calls, but the underlying race condition was always present.

@wmww
Copy link
Contributor Author

wmww commented Feb 24, 2022

Fixed by #2339

@wmww wmww closed this as completed Feb 24, 2022
@AlanGriffiths
Copy link
Contributor

Fixed by #2339

I disagree. Reporting a problem quietly (as a log message) instead of loudly (fatal error) only reduces the severity of the manifestation.

@AlanGriffiths AlanGriffiths reopened this Feb 25, 2022
@bors bors bot closed this as completed in 6f60b2c Mar 10, 2022
@Saviq Saviq mentioned this issue May 12, 2022
bors bot added a commit that referenced this issue May 24, 2022
2423: Release 2.8.0 r=AlanGriffiths,graysonguarino,RAOF,wmww,Saviq a=Saviq

---
> - ABI summary:
>   - miral ABI unchanged at 4
>   - mircommon ABI bumped to 9
>   - mircookie ABI unchanged at 2
>   - mircore ABI unchanged at 1
>   - miroil ABI unchanged at 1
>   - mirplatform ABI unchanged at 23
>   - mirserver ABI bumped to 58
>   - mirwayland ABI unchanged at 3
>   - mirplatformgraphics ABI bumped to 20
>   - mirinputplatform ABI unchanged at 8
> - Enhancements:
>   - Move generated protocol code to build directory (#2300)
>   - Allow --app-env-amend to be supplied multiple times (#2333)
>   - Make window title a configuration option (#2349)
>   - Add fatal_error if unable to bind Wayland socket (#2350)
>   - Add `mold` to the list of supported linkers (#2353)
>   - Platform refactoring towards hybrid GPU support (#2358, #2378, #2407)
>   - Implement wlr_screencopy_unstable_v1 for screenshots (#2383)
>   - Refactor out mf::MirDisplay (#2406)
> - Bugs fixed:
>   - Synchronize buffer swaps to video frame in egl spinner (Fixes #2154)
>   - Do not give menus keyboard focus (Fixes #2324)
>   - Refactor Wayland keyboard input (Fixes #2331)
>   - Further simplify and correct keyboard focus setting (Fixes #2338)
>   - wl_pointer: do not send events when not compatible (Fixes #2341)
>   - Kill clients with error instead of sending unsupported (Fixes #2343)
>   - Initialize sig_handler_desc.sa_mask (#2386)
>   - Fix ThreadedDispatcherSignalTest.keeps_dispatching... (Fixes #2377)

Co-authored-by: Michał Sawicz <michal@sawicz.net>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants