fix: embed Windows executable icon

This commit is contained in:
Steve Cliff
2026-08-20 10:11:36 +01:00
parent 6ecb9efaeb
commit e9030a6dd2
5 changed files with 13 additions and 3 deletions
+12 -2
View File
@@ -21,7 +21,9 @@ The project uses pure Go and sets `CGO_ENABLED=0`. No C compiler, Windows SDK,
```text ```text
cmd/fancywin/ CLI entry point cmd/fancywin/ CLI entry point
assets/fancywin.png Full-resolution generated icon source assets/fancywin.png Full-resolution generated icon source
assets/fancywin.ico Windows executable icon source
internal/assets/ Embedded runtime image assets internal/assets/ Embedded runtime image assets
cmd/fancywin/rsrc_windows_*.syso Embedded Windows executable icon resources
internal/config/ YAML model, loading, and validation internal/config/ YAML model, loading, and validation
internal/layout/ Platform-neutral zone geometry internal/layout/ Platform-neutral zone geometry
internal/platform/platform_windows.go Win32 backend internal/platform/platform_windows.go Win32 backend
@@ -65,6 +67,12 @@ work without a second binary. Normal execution calls `FreeConsole` and operates
through the notification-area icon. `--debug` retains the console, while through the notification-area icon. `--debug` retains the console, while
startup failures in detached mode are shown with `MessageBoxW`. startup failures in detached mode are shown with `MessageBoxW`.
The architecture-specific `.syso` files beside the `main` package embed the
same FancyWin artwork used by the notification-area icon as the executable's
Windows icon resource. The Go toolchain selects and links the matching resource
automatically, so Explorer and shortcuts display the FancyWin icon without any
additional build tools.
## Cross-compiling ## Cross-compiling
The standard x64 build can be produced from the repository root with: The standard x64 build can be produced from the repository root with:
@@ -158,10 +166,12 @@ Test both x64 and ARM64 where hardware is available:
is used for subsequent moves. is used for subsequent moves.
12. Confirm the custom icon is crisp in the normal and overflow notification 12. Confirm the custom icon is crisp in the normal and overflow notification
areas at 100%, 150%, and 200% scaling. areas at 100%, 150%, and 200% scaling.
13. Select each named layout from the tray, confirm the check mark and overlay 13. Create a shortcut to `fancywin.exe` and confirm Explorer displays the same
FancyWin artwork instead of the default application icon.
14. Select each named layout from the tray, confirm the check mark and overlay
change immediately, and verify `active_layout` changes without disturbing change immediately, and verify `active_layout` changes without disturbing
YAML comments or layout formatting. YAML comments or layout formatting.
14. Right-click the tray icon, select `Exit`, and confirm the process and icon 15. Right-click the tray icon, select `Exit`, and confirm the process and icon
both disappear cleanly. both disappear cleanly.
## Architecture ## Architecture
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

+1 -1
View File
@@ -11,7 +11,7 @@ import (
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
) )
const version = "0.5.1" const version = "0.5.2"
var backgroundMode bool var backgroundMode bool
Binary file not shown.
Binary file not shown.