From: Thomas Berlage
Subject: Re: Help with CLX
Date: 
Message-ID: <6045@gmdzi.gmd.de>
In article <·······················@cs.cmu.edu>, ····@cs.cmu.edu (Brad Myers) writes:
> We have been trying to "correctly" create windows under CLX that will make
> all window managers happy, but we keep getting hit by "features" that the
> window managers are "clearly explained in ICCCM".   :-(
Having to read the Inter-Client Communication Conventions Manual is
probably a side effect of creating your own toolkit :-) The ICCCM can be
found in the X11 release.

> 1) We need to set some field so that Sun OpenWindows will allow our windows
> to get the keyboard.  Currently, we must have OpenWindows.FocusLenience:True
> in our .Xdefaults file.  What do we set to get around this?
At least you must set the input hint in the WM_HINTS property (ICCCM 4.1.2.4).
Input focus models are explained in 4.1.7. Use something like (not tested!):
  (change-property window :wm_hints '(1 1 0 0 0 0 0 0 0) :wm-hints 32)
If it does not work, forget about OpenWindows :-)

> 2) We want to create multiple windows using the same display variable, and
> still allow the user to kill the windows using the window manager's Kill window
> command.  Currently, a kill window destroys the entire display (and ALL
> associated windows).  Is there some hint we can set to tell the window
> manager to just send us a message when Kill Window is selected from a menu,
> and not to destroy the display connection.
Your window has to participate in the WM_DELETE_WINDOW protocol (see 4.1.2.7
and 5.2.2). Use
  (change-property window :wm_protocols (list (intern-atom :wm_delete_window))
                   :atom  32)
If you also need the WM_TAKE_FOCUS protocol for point 1, add :wm_take_focus to
the list.

For each protocol mentioned in the list, your window may receive
:client-message events with a type of :wm_protocols, format 32. The
first element in the data sequence contains the atom id of the protocol, the
second a timestamp (see 4.2.8). You can react to the :wm_delete_window
message as you like: delete the window, ask the user, or do nothing if the
user canceled a save.

Hope that helps.

Thomas Berlage (·······@gmdzi.gmd.de)
GMD (German National Research Center for Computer Science)
P.O. Box 1240, 5205 Sankt Augustin 1, Germany