Skip to content

Always uninstall PopupCloser to avoid accumulating display filters - #4589

Open
r-mennig wants to merge 1 commit into
eclipse-platform:masterfrom
r-mennig:fix-popupcloser-filter-leak
Open

r-mennig wants to merge 1 commit into
eclipse-platform:masterfrom
r-mennig:fix-popupcloser-filter-leak

Conversation

@r-mennig

@r-mennig r-mennig commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

AsyncCompletionProposalPopup disposes the proposal shell directly when
proposals are recomputed while typing. CompletionProposalPopup.hide()
only uninstalled the PopupCloser if the shell was still valid, so its
display filters were never removed and every re-install added another
set. Over time this made the additional info popup flicker and block
the UI thread.

The proposal shell's dispose listener now uninstalls the PopupCloser,
however the shell gets disposed. As safety nets, hide() always
uninstalls the closer and PopupCloser.install() first removes any
previous installation. hide() now also always unregisters the proposal
selector from the ContentAssistant, which it skipped as well when the
shell had already been disposed.

Fixes #3582

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±  0     867 suites  ±0   43m 26s ⏱️ - 16m 41s
 8 568 tests +  1   8 328 ✅ +  1  240 💤 ± 0  0 ❌ ±0 
21 432 runs   - 141  20 792 ✅  - 108  640 💤  - 33  0 ❌ ±0 

Results for commit ffb67b3. ± Comparison against base commit 50268ca.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the content-assist popup cleanup changes.

No open issues 🎉

What changed in this PR

Fixes #3582 by preventing JFace content-assist popups from accumulating display filters during asynchronous proposal recomputation, addressing additional-info popup flicker and UI-thread blocking.

Changes:

  • Uninstalls any previous PopupCloser installation before registering listeners and filters again.
  • Always uninstalls the closer when hiding proposals, clears tracked references, and uses the focus event’s display for deferred handling.
  • Adds a regression test that recreates the proposal popup and verifies each mouse move is handled only once.
File Description
tests/​org.eclipse.jface.text.tests/​src/​org/​eclipse/​jface/​text/​tests/​contentassist/​AsyncContentAssistTest.java Tests that popup recreation does not accumulate display filters.
bundles/​org.eclipse.jface.text/​src/​org/​eclipse/​jface/​text/​contentassist/​PopupCloser.java Cleans up prior installations and tracked references; adjusts deferred focus handling.
bundles/​org.eclipse.jface.text/​src/​org/​eclipse/​jface/​text/​contentassist/​CompletionProposalPopup.java Uninstalls the closer even when the proposal shell is already disposed.

Review effort: Balanced

AsyncCompletionProposalPopup disposes the proposal shell directly when
proposals are recomputed while typing. CompletionProposalPopup.hide()
only uninstalled the PopupCloser if the shell was still valid, so its
display filters were never removed and every re-install added another
set. Over time this made the additional info popup flicker and block
the UI thread.

The proposal shell's dispose listener now uninstalls the PopupCloser,
however the shell gets disposed. As safety nets, hide() always
uninstalls the closer and PopupCloser.install() first removes any
previous installation. hide() now also always unregisters the proposal
selector from the ContentAssistant, which it skipped as well when the
shell had already been disposed.

Fixes eclipse-platform#3582

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@r-mennig
r-mennig force-pushed the fix-popupcloser-filter-leak branch from 6b23b86 to ffb67b3 Compare November 24, 2026 08:50
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.

PopupCloser is not always properly uninstalled and pollutes the filterTable of the Display

3 participants