[PATCH 0/1] MR10823: winex11: Allow user to set WM_CLASS
This commit allows the user to optionally set the WM_CLASS by setting an environment variable WINEWMCLASS with the aim of allowing him to ensure desktop environments can correctly identify wine windows, unfortunately the executable filename isn't always sufficient as some programs share a common executable name. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50095 Signed-off-by: Nicholas Little <nicholas.john.little@gmail.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10823
From: Nicholas Little <arealityfarbetween@googlemail.com> This commit allows the user to optionally set the WM_CLASS by setting an environment variable WINEWMCLASS with the aim of allowing him to ensure desktop environments can correctly identify wine windows, unfortunately the executable filename isn't always sufficient as some programs share a common executable name. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50095 Signed-off-by: Nicholas Little <nicholas.john.little@gmail.com> --- dlls/winex11.drv/window.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 457173964eb..6b87166c830 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -837,6 +837,7 @@ static void set_initial_wm_hints( Display *display, Window window ) Atom protocols[3]; Atom dndVersion = WINE_XDND_VERSION; XClassHint *class_hints; + char *wine_wm_class; /* wm protocols */ i = 0; @@ -849,8 +850,9 @@ static void set_initial_wm_hints( Display *display, Window window ) /* class hints */ if ((class_hints = XAllocClassHint())) { + wine_wm_class = getenv( "WINEWMCLASS" ); class_hints->res_name = process_name; - class_hints->res_class = process_name; + class_hints->res_class = wine_wm_class ? wine_wm_class : process_name; XSetClassHint( display, window, class_hints ); XFree( class_hints ); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10823
participants (2)
-
Nicholas Little -
Nicholas Little (@njlittle)