[PATCH] winex11: Allow user to set WM_CLASS

Nicholas Little arealityfarbetween at googlemail.com
Wed May 26 04:23:44 CDT 2021


Hey guys,

Any chance I could get this merged, it's a really simple patch.

Cheers,
Nick

Il lun 21 dic 2020, 00:00 Nicholas Little <arealityfarbetween at googlemail.com>
ha scritto:

> 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
> ---
>  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 );
>      }
> --
> 2.26.2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210526/1975867c/attachment.htm>


More information about the wine-devel mailing list