feat(videoout): use sce_sys/icon0.png as the window icon #1080

Merged
alfalfa-star merged 1 commit from upstream-pr/1080 into main 2026-10-09 22:16:44 +00:00
alfalfa-star commented 2026-10-07 09:43:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-07T09:43:53Z.


What

The game window now uses the title's icon. When /app0/sce_sys/icon0.png exists, DisplayWindow decodes it with the existing decoder_png (RGBA8) and sets it with SDL_SetWindowIcon right after the window is created.

This completes the icon work:

  • #350 embeds icon0.png in the generated Windows .exe. Explorer shows it, and SDL uses it as the window class icon.
  • #353 (open) writes a .desktop entry, so Linux file managers and launchers show the icon.
  • This PR sets the icon on the running window. On Linux, an ELF has no icon resource, so the title bar, taskbar and alt-tab showed a generic icon until now. On Windows the call sets the same image again.

The icon bytes come from the existing AppMetadata HasAppIcon/GetAppIconData, which already check the PNG signature. Without icon0.png nothing changes. If the icon can't be decoded, window creation throws, like the other DisplayWindow failures.

libSceVideoOut now links decoder_png. No new dependencies or flags.

Tested

Linux (Arch, KDE Plasma, Wayland session):

  • libSceVideoOut builds, and guest_video_out_wqhd_detection passes.
  • Standalone check with the same decode and SDL_SetWindowIcon path, a real 512×512 icon0.png and SDL_VIDEODRIVER=x11: _NET_WM_ICON is 512×512, and pixel (100,100) reads 0xffc91312 (ARGB), which matches the decoded RGBA c9 13 12 ff, so the channel order is correct.
  • PPSA14632 (LEGO Horizon Adventures), with this commit on a test tree of main plus other open PRs, SDL_VIDEODRIVER=x11 under XWayland: the game window's _NET_WM_ICON (read with XGetWindowProperty) is 512×512, and pixel (100,100) is 0xffc91312, the same as in the standalone check. (xprop prints the property as empty because it is about 1 MiB.)

Not tested: native Wayland (shows only where the compositor supports xdg-toplevel-icon-v1) and Windows.

No automated test: it needs a real window and display, which CI doesn't have.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none (complements #350 and #353)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4770833102 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1080). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-07T09:43:53Z. --- ### What The game window now uses the title's icon. When `/app0/sce_sys/icon0.png` exists, `DisplayWindow` decodes it with the existing `decoder_png` (RGBA8) and sets it with `SDL_SetWindowIcon` right after the window is created. This completes the icon work: - #350 embeds `icon0.png` in the generated Windows `.exe`. Explorer shows it, and SDL uses it as the window class icon. - #353 (open) writes a `.desktop` entry, so Linux file managers and launchers show the icon. - This PR sets the icon on the running window. On Linux, an ELF has no icon resource, so the title bar, taskbar and alt-tab showed a generic icon until now. On Windows the call sets the same image again. The icon bytes come from the existing AppMetadata `HasAppIcon`/`GetAppIconData`, which already check the PNG signature. Without `icon0.png` nothing changes. If the icon can't be decoded, window creation throws, like the other `DisplayWindow` failures. `libSceVideoOut` now links `decoder_png`. No new dependencies or flags. ### Tested Linux (Arch, KDE Plasma, Wayland session): - `libSceVideoOut` builds, and `guest_video_out_wqhd_detection` passes. - Standalone check with the same decode and `SDL_SetWindowIcon` path, a real 512×512 `icon0.png` and `SDL_VIDEODRIVER=x11`: `_NET_WM_ICON` is 512×512, and pixel (100,100) reads `0xffc91312` (ARGB), which matches the decoded RGBA `c9 13 12 ff`, so the channel order is correct. - PPSA14632 (LEGO Horizon Adventures), with this commit on a test tree of `main` plus other open PRs, `SDL_VIDEODRIVER=x11` under XWayland: the game window's `_NET_WM_ICON` (read with `XGetWindowProperty`) is 512×512, and pixel (100,100) is `0xffc91312`, the same as in the standalone check. (`xprop` prints the property as empty because it is about 1 MiB.) Not tested: native Wayland (shows only where the compositor supports `xdg-toplevel-icon-v1`) and Windows. No automated test: it needs a real window and display, which CI doesn't have. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none (complements #350 and #353) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oneandonlydean commented 2026-10-08 03:25:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T03:25:34Z.


The Tested section still has the hidden FILL IN after the game run line; please add the title run or remove it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051537458 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1080#issuecomment-6051537458). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T03:25:34Z. --- The Tested section still has the hidden `FILL IN after the game run` line; please add the title run or remove it.
alfalfa-star commented 2026-10-08 16:52:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by alfalfa-star on 2026-10-08T16:52:12Z.


Replaced the placeholder with the title run. On PPSA14632 under XWayland, the game window's _NET_WM_ICON is the 512×512 icon0.png, and a sampled pixel matches the decoded PNG. I read it with XGetWindowProperty, because xprop prints a property that large (about 1 MiB) as empty.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6064803431 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1080#issuecomment-6064803431). Originally posted by [alfalfa-star](https://github.com/alfalfa-star) on 2026-10-08T16:52:12Z. --- Replaced the placeholder with the title run. On PPSA14632 under XWayland, the game window's `_NET_WM_ICON` is the 512×512 `icon0.png`, and a sampled pixel matches the decoded PNG. I read it with `XGetWindowProperty`, because `xprop` prints a property that large (about 1 MiB) as empty.
popcoder565 commented 2026-10-09 19:42:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T19:42:44Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 57a529d5, merged onto main 8b393b6e in one build with 31 other PRs that had no Windows run.

  • This PR has no test of its own. It builds, and windows_icon and windows_icon_resource pass.
  • Full ctest in that build: 520 of 521. The one failure is guest_offline_imports, broken by #2359 (reported there).

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6088022797 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1080#issuecomment-6088022797). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T19:42:44Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `57a529d5`, merged onto `main` 8b393b6e in one build with 31 other PRs that had no Windows run. - This PR has no test of its own. It builds, and `windows_icon` and `windows_icon_resource` pass. - Full ctest in that build: 520 of 521. The one failure is `guest_offline_imports`, broken by #2359 (reported there). No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
github-actions[bot] commented 2026-10-09 22:03:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:03:03Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#674 core/libs/prx/libSceVideoOut/CMakeLists.txt L19
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090002165 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1080#issuecomment-6090002165). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-09T22:03:03Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #674 | `core/libs/prx/libSceVideoOut/CMakeLists.txt` [L19](https://github.com/boykopovar/AnyPS5/blob/c2ac5dd93f0b6275634fe57415681f27af95ae7d/core/libs/prx/libSceVideoOut/CMakeLists.txt#L19) | | |
adriadam10 commented 2026-10-09 22:16:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T22:16:41Z.


Checked on Linux: builds and full ctest passes (548/548) merged onto current main; CI is green on the head (linux, windows, conventions). The RGBA8 output of Decoder::Png::Decode matches SDL_PIXELFORMAT_RGBA32, and the surface is freed. Windows build confirmed by @popcoder565. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6090165203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1080#issuecomment-6090165203). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-09T22:16:41Z. --- Checked on Linux: builds and full ctest passes (548/548) merged onto current `main`; CI is green on the head (linux, windows, conventions). The RGBA8 output of `Decoder::Png::Decode` matches `SDL_PIXELFORMAT_RGBA32`, and the surface is freed. Windows build confirmed by @popcoder565. Merging.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!1080
No description provided.