x11drv: set window manager icon hints correctly

Juris Smotrovs juris.smotrovs at sets.lv
Mon Jun 12 08:34:33 CDT 2006

Currently, for many applications the generic Wine icon
or a class default icon is used in window manager caption
or taskbar instead of the application icon set with WM_SETICON.
See, for instance, Bug 3370.

What actually happens is this: the application icon is
correctly set when processing WM_SETICON, but a bit later,
when window is mapped, X11DRV_set_wm_hints resets it back
to class default (or to none, leading to Wine icon).

It seems that X11DRV_set_wm_hints has been designed to be
called only when creating a window:
it alocates WM hints -- XAllocWMHints() -- instead of checking
for existing ones with XGetWMHints(...), and sets
class default icon, instead of checking whether another
icon has been set in the meantime.

However, calls to X11DRV_set_wm_hints have been added at
mapping a window and changing window style (see x11drv/winpos.c).
Thus, Wine currently allocates WM hints anew and resets icon
at every mapping and style change of a window.

I attach a patch to X11DRV_set_wm_hints correcting this issue:
1) it checks for existing WM hints before allocating new ones,
2) it resets icon to class default only if no icon hint
has been set earlier.

Please, let me know if you see anything wrong with this patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: window.diff
Type: text/x-patch
Size: 1325 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20060612/740b13ed/window-0001.diff

More information about the wine-devel mailing list