WM_CLASS purpose?

Giles Atkinson Giles.Atkinson at eu.citrix.com
Mon Oct 22 08:31:04 PDT 2012


WM_CLASS is also used in Ubuntu's Unity environment, Meego, and possibly others as a key to associate windows with the "Desktop Entry File" (http://standards.freedesktop.org/desktop-entry-spec/) of the application.  That controls the icon used for the window and grouping of windows in the UI.

Giles

-----Original Message-----
From: xdg-bounces+giles.atkinson=eu.citrix.com at lists.freedesktop.org [mailto:xdg-bounces+giles.atkinson=eu.citrix.com at lists.freedesktop.org] On Behalf Of Sanel Zukan
Sent: 22 October 2012 05:43
To: Vladimir A. Pavlov
Cc: xdg at lists.freedesktop.org
Subject: Re: WM_CLASS purpose?

Hi,

> 1. What is WM_CLASS's purpose? I thought it's to find
>    X resources set by xrdb but Xrm* functions doesn't
>    seem to depend on it. Is there any specific purpose,
>    or does WM_CLASS have no specific purpose and just
>    stores the info that other apps/users decide on how to use it?

AFAIK it's purpose is to name resources from xrdb database so external
applications could read/modify it if app is using xrdb. From Xlib manual:

"... the name specified as part of WM_CLASS is the formal name of the
application that should be used when retrieving the application's
resources from the resource database."

> 2. Are there rules that an application should follow when
>    setting res_name and res_class?
>
>    For example, let's suppose I have a window manager
>    somebox that has taskbar, dock, menus for starting
>    applications/switching workspaces and configuration dialogs.
>    What should be res_name/res_class for each of them?
>
>    Accordng to manpage, res_name should be the application
>    name and res_class should be the application class. So all
>    the windows listed above should have the same
>    res_name="somebox", res_class="WindowManager". But many
>    apps I've seen don't seem to follow this logic. What's the
>    proper way to set WM_CLASS for the windows?

It is mostly convention and can depends on application needs; there
are no rules I'm aware of. For example, mrxvt will set 'mrxvt/XTerm'
and rxvt-unicode 'urxvt/URxvt', although both could set 'Term' or 'Rxvt'
as class name.

Also toolkits could set totally different stuff.

If you need to dig deeper, maybe you can ping wm-spec-list at gnome.org
or xorg devel list.

Regards,
Sanel
_______________________________________________
xdg mailing list
xdg at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xdg


More information about the xdg mailing list