Skip to content

Use the EXE icon as the window class icon on win32#4472

Open
madd-games wants to merge 6 commits intorust-windowing:masterfrom
madd-games:windows-exe-icons
Open

Use the EXE icon as the window class icon on win32#4472
madd-games wants to merge 6 commits intorust-windowing:masterfrom
madd-games:windows-exe-icons

Conversation

@madd-games
Copy link

@madd-games madd-games commented Feb 1, 2026

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

When registering the window class, we now set hIcon and hIconSm to the icons extracted from the EXE. If they cannot be extracted (e.g. one exists), we are still using NULL, and so the generic icon would still be applied in this case. Since they are the class icons, they'll be used when we send WM_SETICON with NULL - which is when the user calls set_window_icon(None).

This change makes sense because the EXE icon logically should be the default, even though windows requires you to load it explicitly. This is done for example by SDL3 on Windows if not icon is set. Furthetmore, set_window_icon does nothing on most supported platforms; so setting the icon is almost exclusively a windows-specific call right now. This change will reduce windows-specific boilerplate and headaches.

This addresses issue #3932 .

@madsmtm madsmtm added the DS - win32 Affects the Win32/Windows backend label Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DS - win32 Affects the Win32/Windows backend

Development

Successfully merging this pull request may close these issues.

2 participants