Skip to content

Position pop-out windows near the tray icon when no pointer anchor#88

Merged
TheJoeFin merged 1 commit into
TheJoeFin:devfrom
ShahafShavit:fix/tray-icon-window-placement
May 25, 2026
Merged

Position pop-out windows near the tray icon when no pointer anchor#88
TheJoeFin merged 1 commit into
TheJoeFin:devfrom
ShahafShavit:fix/tray-icon-window-placement

Conversation

@ShahafShavit
Copy link
Copy Markdown
Contributor

@ShahafShavit ShahafShavit commented May 24, 2026

Summary

  • Position pop-out windows (TutorialWindow, ManualStationWindow) near the tray icon when no pointer anchor is available
  • Use Shell_NotifyIconGetRect with the WinUIEx tray icon handle to locate the icon on screen
  • Preserve existing cursor-relative placement when CapturePointerAnchor() was called (tray flyout flows)
  • Improve taskbar-edge fallback placement and RTL awareness

Fixes #87

Motivation

On first run, the tutorial window opens without a captured pointer position and currently lands far from the tray icon instead of adjacent to it. Reported on Hebrew (RTL) Windows 10 with a bottom taskbar.

Test plan

  • Reset app data (Settings → Apps → Trdo → Reset) and launch — tutorial opens above/near the tray icon
  • Open tray flyout via right-click — still opens at cursor
  • From flyout, open Manual Station window — still opens near cursor
  • Taskbar on top / left / right — pop-out appears on the correct side
  • RTL system locale — window anchors to the correct horizontal side
Screenshot_7 Screenshot_6

Use Shell_NotifyIconGetRect so TutorialWindow and other pop-outs open
above the tray icon instead of the screen corner. Preserve existing
cursor-relative placement when a pointer anchor is captured.
@TheJoeFin
Copy link
Copy Markdown
Owner

Looks good! Can you target the dev branch and I'll include this in the release coming out soon!

@ShahafShavit ShahafShavit changed the base branch from main to dev May 25, 2026 08:04
@ShahafShavit
Copy link
Copy Markdown
Contributor Author

@TheJoeFin Done!

@TheJoeFin TheJoeFin merged commit 9703a4f into TheJoeFin:dev May 25, 2026
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.

Tutorial window opens far from tray icon on first run

2 participants