Skip to content

Window: set window/app icon#32

Open
codymullins wants to merge 1 commit into
mainfrom
feat/window-icon
Open

Window: set window/app icon#32
codymullins wants to merge 1 commit into
mainfrom
feat/window-icon

Conversation

@codymullins

Copy link
Copy Markdown
Contributor

Closes #24.

Desktop apps set a window/app icon (taskbar, dock, window switcher). Skyline had no icon API.

What changed

  • WindowIcon — a record carrying tightly-packed RGBA8 pixels (Width * Height * 4 bytes).
  • AppWindow.SetIcon(WindowIcon) (runtime) and AppWindowOptions.Icon (creation) → IWindowBackend.SetIcon.
  • GLFW backend — builds a Silk.NET RawImage and calls IWindow.SetWindowIcon.
  • AppKit backend (Skyline.Apple) — builds an NSImage from a CGImage over the pixels and sets NSApplication.ApplicationIconImage (macOS has no per-window icon; this is the dock/app icon).

Tests

  • Skyline.WindowedTests — creates a real GLFW window with Options.Icon and then calls SetIcon at runtime, asserting neither throws (covers the creation-time apply and the runtime path).

Verification

  • dotnet build Skyline.slnx clean (0 warnings); Skyline.Apple builds clean on the macos workload.
  • Headless tests pass; windowed harness passes (88 checks); format-check.sh clean.
  • Coverage: GlfwWindowBackend and AppWindowOptions 100%; overall 98% matches main (the residual uncovered lines are the pre-existing AppWindow/AppHost windowed-thread flakiness, not from this change).

Note

4th open PR in the window/input seam (after #29/#30/#31). Edits are in distinct regions / appends, so merge conflicts are trivial; whichever land after the first will need a small rebase.

Add AppWindow.SetIcon(WindowIcon) and AppWindowOptions.Icon so a shell
can give the window a taskbar/dock icon at creation or at runtime.

- WindowIcon carries tightly-packed RGBA8 pixels.
- GLFW backend builds a Silk.NET RawImage and calls SetWindowIcon.
- AppKit backend builds an NSImage from a CGImage and sets the dock
  icon (ApplicationIconImage); macOS has no per-window icon.

Closes #24
Copilot AI review requested due to automatic review settings June 16, 2026 22:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Window: set window/app icon

2 participants