Skip to content

feat: put desktop icons back in place after a console session - #167

Merged
lippdev merged 2 commits into
mainfrom
feat/desktop-icon-positions
Oct 29, 2026
Merged

lippdev merged 2 commits into
mainfrom
feat/desktop-icon-positions

Conversation

@lippdev

@lippdev lippdev commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Closes #30.

Changing the primary display (every hide mode does it) and disconnecting screens can make Explorer reshuffle the desktop icons. Console Mode already restores the layout and the primary, but not the icons.

What changes

  • Native/DesktopIcons.cs: reads and moves icons through the shell's own view of the desktop (IShellWindows → desktop IShellBrowser → IFolderView: GetItemPosition / SelectAndPositionItems), keyed by the parsing name (path or ::{CLSID}). Each call runs on its own STA thread with a 10 s cap. Skipped when the desktop has Auto arrange icons on.
  • ConsoleEngine.Start reads the positions before any screen changes. Stop puts them back in the background after the desk is restored: three passes (1.5 s, 4 s and 8 s), because Explorer can rearrange more than once. The restore itself doesn't wait for this.
  • DesktopIconLayout.Moves (pure, tested) picks the saved icons that are still there but in a different place. Icons added or removed during the session are left alone.
  • New setting Put desktop icons back in place (RestoreDesktopIcons, on by default) in desktop Settings and in the Console System tab, next to "Send Steam to the tray". Strings are in all 6 catalogs; the GUIDE paragraph is in all 6 languages; TESTING.md has a new checklist.

Verified

  • dotnet test: 502 passed (7 new).
  • App builds on Windows (x64 Debug), 0 errors.
  • On a real desktop, reading works: a throwaway probe read 44 icons with their names and positions through the same code. That desktop has auto-arrange on, so the code correctly skipped it. Moving icons was not exercised: it needs auto-arrange off, see the TESTING.md checklist.

🤖 Generated with Claude Code

lippdev and others added 2 commits October 21, 2026 10:35
Changing the primary display and disconnecting screens can make Explorer
reshuffle the desktop icons. Their positions are now read through the
shell's folder view before the session and put back after the desk is
restored, a few times in the background while Explorer settles. Skipped
when the desktop arranges icons automatically. On by default, with a
toggle in both settings screens.

Closes #30

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes: Reviewed the full PR diff, including the Shell COM icon snapshot/move implementation, session restore scheduling, its setting and localization, and the pure layout tests.

  • Shell icon positioning: Reads desktop item positions before display changes and repositions surviving icons after restore, unless Windows auto-arranges them.
  • Restore lifecycle and setting: Adds a default-on setting in both desktop and console UI, then retries asynchronously after restoring the desk.
  • Supporting coverage and documentation: Adds layout tests, six-language strings and guide text, and a manual Windows checklist.

Pullfrog  | View workflow run | Using gpt-6-luna | 𝕏

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.

Save and restore desktop icon positions around console mode

1 participant