Skip to content

Find/replace overlay tests: correctly dispatch simulated key events#4194

Merged
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:findreplace-overlay-fix-double-key-dispatch-in-test
Jul 18, 2026
Merged

Find/replace overlay tests: correctly dispatch simulated key events#4194
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:findreplace-overlay-fix-double-key-dispatch-in-test

Conversation

@HeikoKlare

Copy link
Copy Markdown
Contributor

Motivation

OverlayAccess.simulateKeyboardInteractionInFindInputField() (used by FindReplaceOverlayTest) simulates a keystroke by notifying listeners on a wrapper widget that internally forwards the event to two different widgets. Since SWT's global event filters react to a dispatched event regardless of which widget triggered it, this causes a single simulated keystroke to be processed twice by anything hooking into such a global filter, such as Eclipse's key-binding dispatch.

This currently has no observable effect, since the overlay's own key handling only relies on a listener attached directly to the actual text control, not on any global event filter. It would, however, cause a command bound to a key sequence through Eclipse's key-binding infrastructure to execute twice per simulated keystroke — which is exactly the failure mode surfaced by #4192, which moves the overlay onto real Eclipse key bindings.

What changed

The synthetic event is now dispatched directly on the search text control instead of the wrapper, matching how a single real keystroke is delivered.

This has no effect on the current state of master (the FindReplaceOverlayTest suite passes unchanged), but is required for the tests to pass correctly on top of #4192.


🤖 Generated with Claude Code

OverlayAccess.simulateKeyboardInteractionInFindInputField() simulated a
keystroke by notifying listeners on a wrapper widget that internally
forwards the event to two different widgets. Since SWT's global event
filters react to a dispatched event regardless of which widget
triggered it, this caused a single simulated keystroke to be processed
twice by anything hooking into such a global filter, such as Eclipse's
key-binding dispatch.

This currently has no effect, since the overlay's own key handling
only relies on a listener attached directly to the actual text
control, not on any global event filter. It would, however, cause a
command bound to a key sequence through Eclipse's key-binding
infrastructure to execute twice per simulated keystroke.

With this change, the synthetic event is dispatched directly on the
search text control instead, matching how a single real keystroke is
delivered.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@HeikoKlare
HeikoKlare marked this pull request as ready for review July 18, 2026 22:12
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   855 files  ±0     855 suites  ±0   49m 6s ⏱️ - 16m 42s
 8 119 tests ±0   7 876 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 259 runs  ±0  19 605 ✅ ±0  654 💤 ±0  0 ❌ ±0 

Results for commit 0966efd. ± Comparison against base commit c3e5d57.

@HeikoKlare
HeikoKlare merged commit 49129cf into eclipse-platform:master Jul 18, 2026
18 checks passed
@HeikoKlare
HeikoKlare deleted the findreplace-overlay-fix-double-key-dispatch-in-test branch July 18, 2026 23:00
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 this pull request may close these issues.

1 participant