Re: winex11.drv: Set WM_COMMAND property so that xlsclients can list Wine.
You should create a WM_CLIENT_LEADER window as described here: http://tronche.com/gui/x/icccm/sec-5.html That way, the windows belonging to a single client can be reliably linked together. I think you can ignore the requirement that the client leader window have an id from the session manager. I have several programs running right now that don't set SM_CLIENT_ID on their client leader window. On Fri, Mar 12, 2010 at 4:18 AM, Kusanagi Kouichi <slash(a)ac.auone-net.jp> wrote:
Signed-off-by: Kusanagi Kouichi <slash(a)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
On 2010-03-13 15:01:47 -0600, Vincent Povirk wrote:
You should create a WM_CLIENT_LEADER window as described here: http://tronche.com/gui/x/icccm/sec-5.html
That way, the windows belonging to a single client can be reliably linked together.
I think you can ignore the requirement that the client leader window have an id from the session manager. I have several programs running right now that don't set SM_CLIENT_ID on their client leader window.
WM_CLIENT_WINDOW is for session management and Wine is not session aware. Window grouping is provided by WM_HINTS.
participants (2)
-
Kusanagi Kouichi -
Vincent Povirk