| Summary: | [Patch] [Windows] Wrong default icon size on windows systems | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Evgeny Vrublevsky <veg> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows 7 | ||
| Attachments: |
Patch, default icon is IDI_APPLICATION (32512)
Patch, default icon is IDI_APPLICATION (32512) Patch, default icon is SDL_Appname (SDL_app) Patch, default icon is the first icon, like in the Explorer |
||
Created attachment 2540 [details]
Patch, default icon is IDI_APPLICATION (32512)
Last time I had uploaded wrong file. This is the right version.
Created attachment 2541 [details]
Patch, default icon is SDL_Appname (SDL_app)
An alternative version. Uses SDL_Appname (SDL_app) as the name of a default icon, like it was before. Bad side of this variant that it is unexpected that changing SDL_Appname requires changing the name of a default icon also. Programmer can forget about it and the window of a game will be without an icon as the result.
Created attachment 2542 [details]
Patch, default icon is the first icon, like in the Explorer
Better idea. We could use the first icon from resources, like the Explorer does. Patch is included. It also correctly loads large and small icons, so it will look nice everywhere.
When you're writing a game using C# (in Visual Studio), it always uses 32512 (IDI_APPLICATION) as the name of an exe icon. It is not easy to change it. Proposed solution with using of the first icon of an exe file as a default icon of the window will solve this problem, and it will not break compatibility with programs which are using "SDL_APP" as the resource name of an icon. Fixed, thanks! https://hg.libsdl.org/SDL/rev/5c06c3aaca68 |
Created attachment 2539 [details] Patch, default icon is IDI_APPLICATION (32512) Original code in the video/windows/SDL_windowsevents.c registers obsolete WNDCLASS (not WNDCLASSEX). As the result only one icon size is used as the small and normal icons. Also original code doesn't specify required size of an icon. As the result when 256x256 icon is available, the program uses it as a default icon, and it looks ugly. We have to use WNDCLASSEX and load icons with proper sizes which we can get using GetSystemMetrics. Also I propose to use IDI_APPLICATION (32512) as the default icon, because it often is used as a default icon. The patch in the attachment already includes this change.