<URL: http://bugs.freeciv.org/Ticket/Display.html?id=35985 >

> [dmarks - Di 20. Feb 2007, 23:11:20]:
> 
> BTW, any way of forcing the win32 builds to use the executable's ICO
> instead of civicon.png as window manager icon? The Windows window
> manager can scale its native format with anti-aliasing, while the
> Linux-style window manager icon looks craptacular (no anti-aliasing at
> all) whatever you do. You can tell the difference very well, since the
> ICO shows up in the taskbar for a second or so while starting up,
> before the Freeciv code changes it to the PNG.
> 
>  ~Daniel
> 

The attached patch makes sure that the icon of the executable is used in
all clients on Windows (this also solves PR#36346).

Index: client/gui-win32/gui_stuff.c
===================================================================
--- client/gui-win32/gui_stuff.c	(revision 12681)
+++ client/gui-win32/gui_stuff.c	(working copy)
@@ -259,7 +259,7 @@
   wndclass->cbClsExtra=0;
   wndclass->cbWndExtra=0;
   wndclass->lpfnWndProc=(WNDPROC) layout_wnd_proc;
-  wndclass->hIcon=NULL;
+  wndclass->hIcon=LoadIcon(GetModuleHandle(NULL), "SDL_app");
   wndclass->hCursor=LoadCursor(NULL,IDC_ARROW);
   wndclass->hInstance=freecivhinst;
   wndclass->hbrBackground=CreateSolidBrush(GetSysColor(15));
Index: win32/clienticon.rc
===================================================================
--- win32/clienticon.rc	(revision 12681)
+++ win32/clienticon.rc	(working copy)
@@ -1,3 +1,4 @@
 #include <windows.h>

-client_icon ICON "client.ico"
+/* must be named "SDL_app" to work with the SDL client */
+SDL_app ICON "client.ico"
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
--- client/gui-gtk-2.0/gui_main.c	(revision 12681)
+++ client/gui-gtk-2.0/gui_main.c	(working copy)
@@ -1409,9 +1409,12 @@
 
   tileset_load_tiles(tileset);
 
+  /* keep the icon of the executable on Windows (see PR#36491) */
+#ifndef WIN32_NATIVE
   /* Only call this after tileset_load_tiles is called. */
   gtk_window_set_icon(GTK_WINDOW(toplevel),
 		sprite_get_pixbuf(get_icon_sprite(tileset, ICON_FREECIV)));
+#endif
 
   setup_widgets();
   load_cursors();
Index: client/gui-win32/gui_stuff.c
===================================================================
--- client/gui-win32/gui_stuff.c	(revision 12681)
+++ client/gui-win32/gui_stuff.c	(working copy)
@@ -259,7 +259,7 @@
   wndclass->cbClsExtra=0;
   wndclass->cbWndExtra=0;
   wndclass->lpfnWndProc=(WNDPROC) layout_wnd_proc;
-  wndclass->hIcon=NULL;
+  wndclass->hIcon=LoadIcon(GetModuleHandle(NULL), "SDL_app");
   wndclass->hCursor=LoadCursor(NULL,IDC_ARROW);
   wndclass->hInstance=freecivhinst;
   wndclass->hbrBackground=CreateSolidBrush(GetSysColor(15));
Index: win32/clienticon.rc
===================================================================
--- win32/clienticon.rc	(revision 12681)
+++ win32/clienticon.rc	(working copy)
@@ -1,3 +1,4 @@
 #include <windows.h>
 
-client_icon ICON "client.ico"
+/* must be named "SDL_app" to work with the SDL client */
+SDL_app ICON "client.ico"
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to