Merge branch 'powimod_icon' into 'master'

Load icon from executable on Windows

Closes #3713

See merge request GNOME/gtk!3326
This commit is contained in:
Matthias Clasen 2021-06-05 12:47:08 +00:00
commit fe774c1ad8

View File

@ -352,12 +352,14 @@ RegisterGdkClass (GdkSurfaceType wtype)
{
char sLoc [MAX_PATH+1];
if (0 != GetModuleFileName (_gdk_dll_hinstance, sLoc, MAX_PATH))
// try to load first icon of executable program
if (0 != GetModuleFileName (NULL, sLoc, MAX_PATH))
{
ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1);
if (0 == hAppIcon && 0 == hAppIconSm)
{
// fallback : load icon from GTK DLL
if (0 != GetModuleFileName (_gdk_dll_hinstance, sLoc, MAX_PATH))
{
ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1);