Skip to content

fix: uniform window cards, real app icons and a clearer close confirmation in the session menu - #135

Merged
lippdev merged 3 commits into
mainfrom
fix/session-menu-window-cards
Oct 3, 2026
Merged

lippdev merged 3 commits into
mainfrom
fix/session-menu-window-cards

Conversation

@lippdev

@lippdev lippdev commented Oct 3, 2026

Copy link
Copy Markdown
Owner

What

Session menu (Select + Y), the "Windows" grid and its close confirmation.

  • Cards all the same size. The card Button shrank to its text, so a short title made a smaller card. It now fills its 250×178 cell.
  • Each program's own icon. Icons no longer come from the exe's shell thumbnail (which failed for Store apps and protected folders, and could return a small icon lost in a big frame). New WindowIcons: the package's tile logo for Store apps (through shell:AppsFolder), else the exe's icon extracted at the size asked for, else the icon the window shows on the taskbar. The generic glyph in a circle is drawn only while there is no icon (it used to stay behind the icon).
  • Close confirmation redesigned. A centred rounded card with the window's icon, program and title, and two equal buttons: "Cancel" (focused on open) and "Close window" in red. The body text no longer repeats the window title (all three catalogs).

Pixel handling (premultiplying, mask for old icons without alpha) is in the pure IconPixels, linked into the test project with tests.

Verification

  • Unit tests: 310 pass locally.
  • Built locally on Windows (Debug, win-x64) and opened the menu in preview on a 1080p monitor: six cards (regular programs, Steam, Explorer) came out the same size, each with its icon, and the confirmation rendered as described.
  • Not checked: a Microsoft Store app's icon (none was open), navigation with a controller (keyboard only), and the TV. The manual checks are in docs/TESTING.md.

🤖 Generated with Claude Code

lippdev and others added 2 commits October 3, 2026 12:26
…ation in the session menu

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <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.

ℹ️ One architecture-specific fallback issue inline.

Reviewed changes This review covers the session-menu window-card sizing, icon loading and pixel conversion, and the redesigned close confirmation.

  • Window icons Adds package-tile, executable, and window-icon resolution plus premultiplied pixel handling.
  • Close confirmation Reworks the modal presentation and removes the repeated title from localized body text.
  • Tests and manual checks Adds IconPixels tests and documents Windows-only visual/controller checks.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6-luna | 𝕏

[DllImport("user32.dll")] private static extern uint GetWindowThreadProcessId(nint hwnd, out uint processId);
[DllImport("user32.dll", EntryPoint = "SendMessageTimeoutW")]
private static extern nint SendMessageTimeout(nint hwnd, uint message, nint wParam, nint lParam, uint flags, uint timeoutMs, out nint result);
[DllImport("user32.dll", EntryPoint = "GetClassLongPtrW")] private static extern nint GetClassLongPtr(nint hwnd, int index);

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.

This direct import does not cover the x86 target: Microsoft documents GetClassLongPtr as a header macro that maps to GetClassLong in 32-bit builds. If both WM_GETICON requests fail, the missing entry point aborts FromWindow, so Load catches it and the taskbar-icon fallback is skipped.

Technical details
# Keep the taskbar-icon fallback working on x86

## Affected sites
- `src/ConsoleMode/Native/WindowIcons.cs:195` — imports `GetClassLongPtrW` directly; the x86 API is `GetClassLongW`.
- `src/ConsoleMode/Native/WindowIcons.cs:97-100` — this lookup is reached after `WM_GETICON` returns no icon; the thrown entry-point exception prevents trying the next class-icon index.

## Required outcome
- Read class icons through the correct API entry point on x86 as well as x64/ARM64.

## Suggested approach
- Select the `GetClassLongW` entry point for x86 and `GetClassLongPtrW` for pointer-sized targets (or use an equivalent architecture-aware wrapper).

## Reference
- [Microsoft: GetClassLongPtrW](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getclasslongptrw) documents that 32-bit builds map the macro to `GetClassLong`.

Co-Authored-By: Claude Fable 5.1 <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 in this incremental change.

Reviewed changes Reviewed the beta.4 release preparation added since the prior Pullfrog review.

  • Beta.4 metadata Updated the project version and recorded the session-menu fixes in the Portuguese and English changelogs.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6-luna | 𝕏

@lippdev
lippdev merged commit fb20b9f into main Oct 3, 2026
5 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