[PATCH v2 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> -- v2: winex11: Allow user to set WM_CLASS 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 d2d53a40be3..75e6eba7600 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1161,6 +1161,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; @@ -1173,8 +1174,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
Fairly old commit, small but still a little surprised it rebased cleanly onto master. Happy to properly `--reset-author` on it to link it to my less juvenile email identity - for now just added a signed off tag. Let me know if you want that change. (will also refresh my knowledge of the contribution guidelines) Now I'm looking at it I'm also considering where this feature should be documented -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10823#note_138920
On Sat May 16 12:32:03 2026 +0000, Nicholas Little wrote:
Fairly old commit, small but still a little surprised it rebased cleanly onto master. Happy to properly `--reset-author` on it to link it to my less juvenile email identity - for now just added a signed off tag. Let me know if you want that change. (will also refresh my knowledge of the contribution guidelines) Now I'm looking at it I'm also considering where this feature should be documented Hi, @julliard, re-ran the pipeline today after the initial failure and it was successful. What steps should I take to get this into a merge-ready state?
* commit message rewording? author reset? removal of the signed-off-by myself tag? rebase on to current master? * any documentation I should add? * any unit tests I should write? Any pointers on the above would be helpful, cheers -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10823#note_140203
participants (2)
-
Nicholas Little -
Nicholas Little (@njlittle)