Record backend input events in the event hook - #12720
Open
tilladam wants to merge 3 commits into
Open
Conversation
tilladam
force-pushed
the
mcp/record-backend-input
branch
from
July 30, 2026 19:22
d3e3ff8 to
b19e620
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Feeds real backend input (winit and Qt) through the
window_event_hooksothat user-generated pointer, wheel and key events are observable to the hook,
each reported exactly once with its true dispatch result.
Previously the hook only saw events that were replayed through the public
Window::dispatch_event_with_result; input that arrived directly from thebackend and went straight into
process_mouse_input/process_key_inputwas invisible to it.
How
WindowInnergains two#[doc(hidden)]helpers,process_mouse_input_and_notifyandprocess_key_input_and_notify, whichrun the normal internal dispatch and then notify the hook with the event's
public
WindowEventrepresentation and itsWindowEventDispatchResult.notify_window_eventhelper does the context/hook lookup;dispatch_event_with_resultis refactored to reuse it (no behavior change).WindowEventand route it through the new helpers.PointerExitedis reported asAcceptedunconditionally, matching theexisting teardown-event semantics in
dispatch_event_with_result.drag_leave_event) so it is not mis-recorded as a pointer exit.Tests
Adds
dispatch_result_testscoverage in the testing backend asserting thatthe new backend helpers notify the hook exactly once with the correct result
for pointer, key and pointer-exit events.
Notes / follow-ups
auto-repeat flag to KeyEvent" (separate PR). This PR is independent and
green on its own — it reads winit's
event.repeatto emitKeyPressRepeatedfor recording — but the two are best merged together,the repeat fix first.
Touch, Qt pinch/rotation, multi-touch) isnot recorded: the public
platform::WindowEventhas no variant for it.Left as a follow-up.
phasedoes not round-trip through the publicPointerScrolledvariant, which has no phase field.