Skip to content

feat(taskbar): add custom thumbnail with Aero Peek live preview - #110

Merged
lijy91 merged 1 commit into
mainfrom
feat/window-taskbar-thumbnail-issue-71
Dec 1, 2026
Merged

lijy91 merged 1 commit into
mainfrom
feat/window-taskbar-thumbnail-issue-71

Conversation

@lijy91

@lijy91 lijy91 commented Dec 1, 2026

Copy link
Copy Markdown
Member

Summary

Implements custom taskbar thumbnail support for WindowTaskbar (libnativeapi/nativeapi#71):

  • Adds WindowTaskbar::SetThumbnail(std::shared_ptr<Image> thumbnail), GetThumbnail() const, and ResetThumbnail() (plus generated C ABI).
  • On Windows (window_taskbar_windows.cpp):
    • Enables DWMWA_FORCE_ICONIC_REPRESENTATION and DWMWA_HAS_ICONIC_BITMAP and responds to WM_DWMSENDICONICTHUMBNAIL by scaling the custom image (aspect-ratio preserved) onto a 32bpp top-down DIB over an opaque black background and calling DwmSetIconicThumbnail.
    • Retains Aero Peek live preview by handling WM_DWMSENDICONICLIVEPREVIEWBITMAP: captures the live window via PrintWindow(..., PW_RENDERFULLCONTENT) cropped to DWMWA_EXTENDED_FRAME_BOUNDS (with alpha normalization) when visible, or composites a dark centered cover preview when minimized/unavailable, then calls DwmSetIconicLivePreviewBitmap.
    • Replays custom thumbnail state on TaskbarButtonCreated and cleans up on WM_NCDESTROY / ResetThumbnail().
  • Adds non-Windows stubs for macOS, iOS, Linux, Android, OpenHarmony, and WASM.
  • Adds unit & C ABI tests in tests/window_taskbar_test.cpp and interactive buttons in examples/window_taskbar_example/main.cpp.

@lijy91
lijy91 merged commit ed9e145 into main Dec 1, 2026
20 of 21 checks passed
@lijy91
lijy91 deleted the feat/window-taskbar-thumbnail-issue-71 branch December 1, 2026 10:13
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