Skip to content

fix: dispose description window when toggled off, not just hide it - #119

Merged
bobbylight merged 1 commit into
masterfrom
fix-desc-window-ghost-linux
Aug 3, 2026
Merged

fix: dispose description window when toggled off, not just hide it#119
bobbylight merged 1 commit into
masterfrom
fix-desc-window-ghost-linux

Conversation

@bobbylight

Copy link
Copy Markdown
Owner

Summary

  • Fixes AutoCompleteDescWindow doesn't hide itself well when showDescWindow is toggled (On Ubuntu only?) #84 — on some Linux/X11 window managers, the auto-complete description window could be left behind as a blank "ghost" window after it was disabled and the completion popup reopened.
  • AutoCompletion.setShowDescWindow(false) now disposes the description window's native peer (AutoCompletePopupWindow.disposeDescWindow()) instead of relying on setVisible(false), which can leave a stale, un-repainted window mapped on screen when a JWindow's visibility is toggled in quick succession (a known class of OpenJDK/X11 issues, e.g. JDK-8173332). The window is lazily recreated the next time it's needed.
  • This is scoped narrowly to the explicit "show desc window" preference toggle, not the routine popup-hide path, so it doesn't add native window churn to the hot path of every completion-popup dismissal.

Test plan

  • Added AutoCompletionTest#setShowDescWindow_false_disposesExistingDescWindow, which shows the completion + description windows, toggles the description window off, and asserts the description window's native peer is disposed (not just hidden).
  • ./gradlew clean build passes (compiles, tests, checkstyle, spotbugs).
  • Verified the new test fails against the pre-fix code (stashed the fix, confirmed the test's supporting accessor methods — and thus the regression check — don't exist without it) and passes with the fix applied.

🤖 Generated with Claude Code

On some Linux/X11 window managers, quickly hiding a JWindow shortly
after showing it can leave a blank "ghost" window on screen that is
never un-mapped or repainted. Disposing of the description window's
native peer when it's toggled off, instead of merely calling
setVisible(false), avoids this. The window is lazily recreated the
next time it's needed.

Fixes #84

Co-Authored-By: Claude <noreply@anthropic.com>
@bobbylight bobbylight added the bug label Aug 3, 2026
@bobbylight bobbylight self-assigned this Aug 3, 2026
@bobbylight
bobbylight marked this pull request as ready for review August 3, 2026 03:11
@bobbylight
bobbylight merged commit 9eeb3cb into master Aug 3, 2026
4 checks passed
@bobbylight bobbylight added this to the 4.0.0 milestone Aug 3, 2026
@bobbylight
bobbylight deleted the fix-desc-window-ghost-linux branch August 3, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AutoCompleteDescWindow doesn't hide itself well when showDescWindow is toggled (On Ubuntu only?)

1 participant