Set the class resource name to the name of the main binary (suggested
by Rasterman).
diff --git a/dlls/x11drv/window.c b/dlls/x11drv/window.c
index c896c91..e0cd8a0 100644
--- a/dlls/x11drv/window.c
+++ b/dlls/x11drv/window.c
@@ -374,6 +374,38 @@
/***********************************************************************
+ * get_process_name
+ *
+ * get the name of the current process for setting class hints
+ */
+static char *get_process_name(void)
+{
+ static char *name;
+
+ if (!name)
+ {
+ WCHAR module[MAX_PATH];
+ DWORD len = GetModuleFileNameW( 0, module, MAX_PATH );
+ if (len && len < MAX_PATH)
+ {
+ char *ptr;
+ WCHAR *p, *appname = module;
+
+ if ((p = strrchrW( appname, '/' ))) appname = p + 1;
+ if ((p = strrchrW( appname, '\\' ))) appname = p + 1;
+ len = WideCharToMultiByte( CP_UNIXCP, 0, appname, -1, NULL, 0, NULL, NULL );
+ if ((ptr = HeapAlloc( GetProcessHeap(), 0, len )))
+ {
+ WideCharToMultiByte( CP_UNIXCP, 0, appname, -1, ptr, len, NULL, NULL );
+ name = ptr;
+ }
+ }
+ }
+ return name;
+}
+
+
+/***********************************************************************
* X11DRV_set_wm_hints
*
* Set the window manager hints for a newly-created window
@@ -390,6 +422,7 @@
DWORD style = GetWindowLongW( data->hwnd, GWL_STYLE );
DWORD ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE );
HWND owner = GetWindow( data->hwnd, GW_OWNER );
+ char *process_name = get_process_name();
/* transient for hint */
if (owner)
@@ -415,7 +448,7 @@
/* class hints */
if ((class_hints = XAllocClassHint()))
{
- class_hints->res_name = "wine";
+ class_hints->res_name = process_name;
class_hints->res_class = "Wine";
XSetClassHint( display, data->whole_window, class_hints );
XFree( class_hints );