Skip to content

Fix Windows tray window position on first display#371

Merged
kdroidFilter merged 1 commit intomasterfrom
fix/windows-tray-initial-position
Feb 6, 2026
Merged

Fix Windows tray window position on first display#371
kdroidFilter merged 1 commit intomasterfrom
fix/windows-tray-initial-position

Conversation

@kdroidFilter
Copy link
Owner

Summary

  • Fix incorrect window position when tray popup is shown on first display (with initiallyVisible=true)
  • Windows reorganizes tray icons after creation, causing the initial position capture to be stale
  • The window now waits for Windows to stabilize and re-captures the position before displaying

Changes

  • Convert native physical coordinates to logical coordinates for DPI scaling support
  • Add refreshPosition() method to force re-capture of tray icon position
  • Wait 400ms for Windows to finish reorganizing tray icons before showing
  • Initialize dialog position off-screen to prevent flash at wrong location
  • Fix compilation error in TrayApp.kt (return@label inside invokeLater)

Test plan

  • Test with initiallyVisible=true on Windows
  • Verify window appears centered under tray icon on first display
  • Verify subsequent clicks position correctly

Windows reorganizes tray icons after creation, causing the initial
position capture to be incorrect. The window would appear offset
from the actual tray icon location.

Changes:
- Convert native physical coordinates to logical coordinates for DPI scaling
- Wait for Windows to stabilize tray icons before capturing position
- Add refreshPosition() to re-capture position just before showing window
- Initialize dialog position off-screen to prevent flash at wrong location
- Fix TrayApp.kt compilation error with return@label inside invokeLater
@kdroidFilter kdroidFilter merged commit 1faadff into master Feb 6, 2026
3 checks passed
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