winex11.drv: Set WM_COMMAND property so that xlsclients can list Wine.

Kusanagi Kouichi slash at ac.auone-net.jp
Fri Mar 12 04:18:39 CST 2010


Signed-off-by: Kusanagi Kouichi <slash at ac.auone-net.jp>
---
 dlls/winex11.drv/window.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 47f7245..73eba1f 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -947,6 +947,9 @@ static void set_initial_wm_hints( Display *display, struct x11drv_win_data *data
     Atom dndVersion = WINE_XDND_VERSION;
     XClassHint *class_hints;
     char *process_name = get_process_name();
+    LPCWSTR cmdline;
+    int len;
+    LPSTR buf;
 
     wine_tsx11_lock();
 
@@ -969,6 +972,17 @@ static void set_initial_wm_hints( Display *display, struct x11drv_win_data *data
         XFree( class_hints );
     }
 
+    /* set WM_COMMAND */
+    cmdline = GetCommandLineW();
+    len = WideCharToMultiByte(CP_UNIXCP, 0, cmdline, -1, NULL, 0, NULL, NULL);
+    buf = HeapAlloc(GetProcessHeap(), 0, len);
+    if (buf != NULL)
+    {
+        WideCharToMultiByte(CP_UNIXCP, 0, cmdline, -1, buf, len, NULL, NULL);
+        XSetCommand(display, data->whole_window, &buf, 1);
+        HeapFree(GetProcessHeap(), 0, buf);
+    }
+
     /* set the WM_CLIENT_MACHINE and WM_LOCALE_NAME properties */
     XSetWMProperties(display, data->whole_window, NULL, NULL, NULL, 0, NULL, NULL, NULL);
     /* set the pid. together, these properties are needed so the window manager can kill us if we freeze */
-- 
1.7.0




More information about the wine-patches mailing list