Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!bionet!agate!ucbvax!hplabs!hpfcdc!hpfclp!diamant From: diamant@hpfclp.SDE.HP.COM (John Diamant) Newsgroups: comp.windows.x Subject: Re: Window Managers. Message-ID: <9740103@hpfclp.SDE.HP.COM> Date: 21 Aug 89 06:54:42 GMT References: <252@bii.UUCP> Organization: HP SESD, Fort Collins, CO Lines: 36 > 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