Re: [Maybe OT]: Sawfish 'strange' behaviours



rob <mailingLists pangolin org uk> writes:  
It's what every other app dose (and it's what you said to do in the GGAD
book). 

Sure, but I was wrong. ;-) At least according to the ICCCM.

Reading the ICCCM it seems to do what you'd expect: the class bit
specifies some set of windows that should be considered a group and type
is used to differentiate between windows of the same class.(btw i
couldn't find where it said that class and type should be the same all I
could find was section 4.2.1.5 on the WM_CLASS)

What 4.1.2.5 says is that the name should identify an application
instance, not a window type. It also specifies that you should use the
following algorithm to set the class name:

 - the -name command line arg
 - else RESOURCE_NAME env variable
 - else the trailing part of argv[0]

And the class should be a string that's the same across all
application instances that are the same type of application.

So GTK pretty much already does that stuff, except that it uses --name
instead of -name and I think ignores RESOURCE_NAME. Anyway, we
typically end up with argv[0].

Setting the role seems to enable you to tell apart windows of the same
type. But you'd still need to set the class bit unless your happy with
what ever default one you get.

The role "uniquely identifies a window among all the windows that have
the same client leader window." So for "singleton" windows such as a
preferences dialog the role can reflect the type of window, and for
window types that can have multiple instances (e.g. a document window)
it would probably include some kind of unique ID. The primary purpose
of the role is for session management.
 
The result of all this is that new windows are created the same size as
the last window of the same type, they stack properly on the panel, and
have the correct icon. 
If I don't set the WM_CLASS all windows of the app are created the same
size(which looks real ugly if the main window is maximised and you pop
up a one line dialog which also maximises itself), and they don't stack
properly on the panel. 

Looking at the gtk2 docs it seems as if by default it sets the class to
the name of the app and the type to the name of the window (which is
probably what is wanted most of the time but wouldn't work for me as I
have windows from different apps in the same class). But then it says
that class and type are always set to the same thing so I don't know. 

Ok I've probably bored and confused everybody by now so I'll stop

No, it's a legitimate issue. The problem is that what the ICCCM
specifies really isn't useful, so lots of window managers have this
"identify windows by class/role" feature that works best if apps do
something nonstandard. But not all window managers do that. 
And so it's just a totally unspecified mess and you can't do anything
that will really work reliably.

IMO the correct solution is to have the window manager ignore the
class/name for the most part.

Havoc



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