#55667: docs: remove outdated focus note from webContents.sendInputEvent()
Description of Change
The note under sendInputEvent() says the window needs to be focused for it to work. It came from #8299 in 2016, where a shown window on Ubuntu got no char events while another window had focus. That no longer holds, and the sendInputEvent(event) specs already send key events to a show: false window that never gets focus.
I checked windows without focus on macOS, Windows and Linux with Electron 45.2.3: never shown, shown behind another focused window, shown with showInactive(), hidden after show(), and minimized. In all of them, typing into an <input> and clicking a button through sendInputEvent() worked as in a focused window, with trusted keydown, input and click events. Meanwhile win.isFocused() and document.hasFocus() both returned false. On Linux this ran under Xvfb with openbox. The probe and its results are in this run.
Disclosure: I developed this with Claude (Claude Code), and reviewed and verified it.
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
- relevant API documentation, tutorials, and examples are updated and follow the documentation style guide
- PR release notes describe the change in a way relevant to app developers, and are capitalized, punctuated, past tense, and no longer than 80 characters.
Release Notes
Notes: none
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron