Skip to content

Update minimized window previews with current clock text #126

@danielchalmers

Description

@danielchalmers

Proposal
When the clock is minimized or started hidden, Windows may show a stale Alt+Tab/taskbar preview captured at the time the window was minimized. Keeping the internal timer running does not necessarily update that preview because DWM often uses a cached minimized-window bitmap.

Add support for custom DWM iconic thumbnails while the window is minimized. The app should render the current clock text into a bitmap and provide it to Windows through the DWM preview APIs, then invalidate that bitmap when the clock text changes.

Why
Users may reasonably expect the minimized preview to show the current clock, especially now that the app keeps updating while hidden or minimized. Without a custom preview, the app’s internal state can be correct while Windows still displays old clock text, making it look like the clock is stuck.

Implementation Notes
Use DWMWA_HAS_ICONIC_BITMAP and DWMWA_FORCE_ICONIC_REPRESENTATION, handle WM_DWMSENDICONICTHUMBNAIL / WM_DWMSENDICONICLIVEPREVIEWBITMAP, render the current clock text to a bitmap, and call DwmInvalidateIconicBitmaps when the displayed time changes while minimized.

Keep this separate from timer lifecycle work because it requires native interop, DPI handling, bitmap sizing, and visual verification on Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions