[comp.windows.x] Window Managers

tom@ICASE.EDU (Tom Crockett) (10/27/88)

Could someone knowledgeable post a short note comparing the publicly available
window managers for X?  Are uwm, twm, and awm the only ones? (Let's ignore
wm.)  What are the advantages and disadvantages of each?  A paragraph or so on
each should suffice.  Thanks in advance,


Tom Crockett

--------------------------------------------------------------------------------
Institute for Computer Applications in Science and Engineering
M.S. 132C, NASA Langley Research Center
Hampton, VA  23665

e-mail:  tom@icase.edu		phone:   (804) 865-4097
--------------------------------------------------------------------------------

dple@bii.UUCP (david levine) (08/15/89)

Is there any way for a client to poll if a window manager
is present. I think this would be an important feature
when installing colormaps and trying to be ICCCM compliant
at the same time. Please post the result because there 
might be other people that would want to know the answer.


==================================================================

	
     ...         ...
    .    .     .    .	David Levine
    .     *   .     .	Software Engineer
     .      .      .
      .   .   .   .	Bruker Instruments Inc. USA
       . BRUKER .	Billerica, MA. 01821
      .   .   .  .
     .      .     .	...!{uunet,ulowell}!bii!dple	UUCP
    .     *  .     .	dple%bii.UUCP@uunet.uu.net	Internet
     ...        ... 


=================================================================

toml@Solbourne.COM (Tom LaStrange) (08/16/89)

> Is there any way for a client to poll if a window manager
> is present. I think this would be an important feature
> when installing colormaps and trying to be ICCCM compliant
> at the same time. Please post the result because there 
> might be other people that would want to know the answer.

Sure, you can do the same thing that most window managers will do 
to determine if another window manager is running.  Set up an error
handler and XSelectInput on the root window with SubstructureRedirectMask.
If you go through your error handler, chances are good that a window manager
is running.  The only problem is that if you start your application 
when no window manager is running, how do you detect when a window manager
is started sometime later?

You can look in contrib/windowmgrs/twm/twm.c for an example of the
above code.

--
Tom LaStrange

Solbourne Computer Inc.    ARPA: toml@Solbourne.COM
1900 Pike Rd.              UUCP: ...!{boulder,nbires,sun}!stan!toml
Longmont, CO  80501

JONESD@kcgl1.eng.ohio-state.edu (David Jones) (08/16/89)

Tom LaStrange (<1946@imelda.Solbourne.COM>) writes:
>                                                     Set up an error
> handler and XSelectInput on the root window with SubstructureRedirectMask.
> If you go through your error handler, chances are good that a window manager
> is running.  The only problem is that if you start your application
> when no window manager is running, how do you detect when a window manager
> is started sometime later?

You don't need to go through all those circumlocutions, just use
XGetWindowAttributes on root window and check the AllEvents mask for
the SubstructureRedirectMask event.

David L. Jones               |      Phone:    (614) 292-6929
Ohio State Unviversity       |      Internet:
1971 Neil Ave. Rm. 406       |               jonesd@kcgl1.eng.ohio-state.edu
Columbus, OH 43210           |               jones-d@eng.ohio-state.edu

Disclaimer: A repudiation of a claim.

jv@mh.nl (Johan Vromans) (08/17/89)

In article <2832@quanta.eng.ohio-state.edu> JONESD@kcgl1.eng.ohio-state.edu (David Jones) writes:

   You don't need to go through all those circumlocutions, just use
   XGetWindowAttributes on root window and check the AllEvents mask for
   the SubstructureRedirectMask event.

And now for the next question: how can I find out WHICH window manager
is controlling my display? When starting up I like to organize things
(e.g. placement of windows and icons) depending on the window manager
in use.

	Johan
--
Johan Vromans				       jv@mh.nl via internet backbones
Multihouse Automatisering bv		       uucp: ..!{mcvax,hp4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62944/62500
------------------------ "Arms are made for hugging" -------------------------

diamant@hpfclp.SDE.HP.COM (John Diamant) (08/21/89)

>    You don't need to go through all those circumlocutions, just use
>    XGetWindowAttributes on root window and check the AllEvents mask for
>    the SubstructureRedirectMask event.
> 
> And now for the next question: how can I find out WHICH window manager
> is controlling my display? When starting up I like to organize things
> (e.g. placement of windows and icons) depending on the window manager
> in use.

This is not something your applications need to worry about.  Rather
this would be something in your environment.  I can't tell you how to
find out automatically which window manager is running, but you can
set up your Xresources so that it is easy to switch between them.  If
you use xrdb, you can put #ifdef calls in based on arbitrary defined
constants.  Then you can invoke xrdb with the appropriate constant
defined to specify your environment.

For instance, in your .Xresources file (whatever you call it):

#ifdef TWM
foo.ToplevelShell.Geometry:	+1+1
#else
foo.ToplevelShell.Geometry:	-1-1

Then when you invoke xrdb, do the following if you're running
twm:
	xrdb -DTWM ~/.Xresources

This isn't completely automatic, but you could build it into a
script you use to start up your window manager.


John Diamant
Software Engineering Systems Division
Hewlett-Packard Co.		Internet: diamant@hpfclp.sde.hp.com
Fort Collins, CO		    UUCP: {hplabs,hpfcla}!hpfclp!diamant

andrew@isgtec.UUCP (Andrew) (10/14/89)

This is a question for those of you who are running a different
window manager on top of (actually instead of) the XNeWS 
postscript window manager. I finally got my OSF/MOTIF window
manager to compile and run (after taking off the optimization option!)
but now I am having trouble "removing" the XNeWS window manager.

I am running a SPARC Station 1, with SunOS 4.0.3c,
with 1.0 OpenWindows (Beta 2) server, and am now trying to use the
Motif 1.0 Window manager. 

The OpenWindows documentation says to type the following commands while
running the server:
	psh
	stopwm
At this point, I am supposed to be able to run another window manager.
WRONG!!! Only new clients are looked after by the new window manager.
Any clients that were started up with the server are inactive.


What am I doing wrong? Can/should I modify the init.ps file in 
$OPENWINHOME/etc/NeWS? Can I not start up with a different window
manager?

Thx in advance.
-- 
Andrew MacLean                     ...uunet!mnetor!lsuc!isgtec!andrew
Success is a journey, not an adventure!   ...utzoo!lsuc!isgtec!andrew
ISG Technologies Inc. 3030 Orlando Dr. Mississauga. Ont. Can. L4V 1S8

smarks@SUN.COM (10/17/89)

| From:  mailrus!jarvis.csri.toronto.edu!utgpu!utzoo!censor!isgtec!andrew@rutgers.edu  (Andrew)
| Date:  13 Oct 89 19:28:57 GMT
| Subject:  Window Managers
| 
| This is a question for those of you who are running a different
| window manager on top of (actually instead of) the XNeWS 
| postscript window manager. I finally got my OSF/MOTIF window
| manager to compile and run (after taking off the optimization option!)
| but now I am having trouble "removing" the XNeWS window manager.
| 
| I am running a SPARC Station 1, with SunOS 4.0.3c,
| with 1.0 OpenWindows (Beta 2) server, and am now trying to use the
| Motif 1.0 Window manager. 

Your first step should be to get an up-to-date version of the software,
i.e. 1.0, not 1.0 beta2 or anything like that.  Talk to your local Sun
contact to find out how to get a copy.  The 1.0 documentation has changed,
so make sure to get a copy of it along with the software.

Basically, the answer is to run "ps ax | grep pswm" to find the process id
of the window manager, and then send it a TERM signal.

s'marks

Stuart W. Marks			ARPA: smarks@eng.sun.com
Window Systems Group		UUCP: sun!smarks
Sun Microsystems, Inc.

egnu02@castle.ed.ac.uk (M Rae) (12/04/90)

How do window managers manage to draw lines over the top of all the
windows during resizing and moving a window?
Any small pieces of code which do this would be most welcome.

	-Mark

etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (12/05/90)

The general concept is that you draw a line using
GXXor.  You draw a line the first time and it inverts
the colors beneath it.  The draw the same line in
exactly the same place again and the colors invert
again giving you the original pixels.

	The GC for drawing this line is as follows :

        Pixel white = WhitePixel(dpy,screen) ;
        Pixel black = BlackPixel(dpy,screen) ;
        values.foreground = black ^ white ;
        values.background = white ;
        values.line_width = 0 ;
        values.function = GXxor ;
        values.plane_mask = values.foreground ;
        values.subwindow_mode = IncludeInferiors ;
        return XtGetGC(w,
                (unsigned long)GCForeground |
                (unsigned long)GCBackground |
                (unsigned long)GCLineWidth  |
                (unsigned long)GCSubwindowMode |
                (unsigned long)GCPlaneMask  |
                (unsigned long)GCFunction,
                &values);
--
					Eric Taylor
					Baylor College of Medicine
					etaylor@wilkins.bcm.tmc.edu
					(713) 798-3776

graeme@labtam.labtam.oz (Graeme Gill) (12/05/90)

In article <3055@gazette.bcm.tmc.edu>, etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) writes:
> 
> The general concept is that you draw a line using
> GXXor.  You draw a line the first time and it inverts
> the colors beneath it.  The draw the same line in
> exactly the same place again and the colors invert
> again giving you the original pixels.
 
 	The GC for drawing this line is as follows :
 
         Pixel white = WhitePixel(dpy,screen) ;
         Pixel black = BlackPixel(dpy,screen) ;
         values.foreground = black ^ white ;
         values.background = white ;
         values.line_width = 0 ;
         values.function = GXxor ;
         values.plane_mask = values.foreground ;
                             ^^^^^^^^^^^^^^^^^
etc.

	Setting the plane mask is both un-necessary, and potentially
slow on some systems. Systems with screen pixmap depth > 1 may or
may not have hardware support for the plane mask, hence it is best
to leave all planes enabled. Setting the foreground to the xor of the
two colours concerned is sufficient to restrict the operation to
the appropriate planes.

	Graeme Gill
	Labtam I. S. Pty. Ltd.

etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (12/06/90)

|> Setting the plane mask is both un-necessary, and potentially
|> slow on some systems. Systems with screen pixmap depth > 1 may or
|> may not have hardware support for the plane mask, hence it is best
|> to leave all planes enabled. Setting the foreground to the xor of the
|> two colours concerned is sufficient to restrict the operation to
|> the appropriate planes.
|> 
|> 	Graeme Gill
|> 	Labtam I. S. Pty. Ltd.

Well, I'll tell ya.  The is no guarantee that XXor will give you
a color any different than the background.

We have tried many different variations, and this one has worked for
every workstation we have used :
	Evans & Sutherland ESV
	Stardent
	NCD X terminals
	Sparc Stations
	Solbournes
	386i's
	Tektronix
	SGI

	I am not sure if it worked with the DEC 3100 or not.
	I think it did.

The window managers twm and swm fail in drawing their lines to
the ESV.
--
					Eric Taylor
					Baylor College of Medicine
					etaylor@wilkins.bcm.tmc.edu
					(713) 798-3776