Re: New window-class proposal, and question on ICCCM & ewmh.



On Saturday 20 February 2010 07:52:05 Teika Kazura wrote:
> What's WM_CLASS? WM_CLASS has two elements, "instance" and "class",
> but the current window-class returns the "class" only.

The main use of application class is resource database lookup in Xt 
based widget toolkits, which are getting rarer.  The instance name is 
configurable but the class name is not.  You can change the instance 
name with, e.g, xterm -name foobar, which causes xterm to look up 
resources first under foobar and if not found there, under XTerm.  By 
convention instance names are lowercase and class names CamelCase.

> Though I don't have GIMP now, it has three windows, so I
> guess the class is common to all, and the instance varies for
> each.

You guess too much.  WM_CLASS names an _application_ instance, not a 
window instance.  It is also by no means required to be unique: people 
often have several instances of xterm running without bothering to give 
them different instance names.  There is WM_WINDOW_ROLE for identifying 
different windows of the same application based on function.  It is 
specified in the ICCCM under session management: SM_CLIENT_ID and 
WM_WINDOW_ROLE together must uniquely identify a window (Gimp does not 
get that quite right, it seems).

> Firefox example is "Navigator" for main window, and "Browser"
> for config window, and so on.

So Firefox is broken, but as it does not use Xt, there is not much harm 
done.

-- 
	Timo Korvola		<URL:http://www.iki.fi/tkorvola>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]