SGI's migration to X

Mike Yang mikey at eukanuba.wpd.sgi.com
Wed Sep 5 03:50:23 AEST 1990


In article <SLEHAR.90Sep4105933 at cochlea.bu.edu>, slehar at cochlea.bu.edu (Steve Lehar) writes:
|> 
|> When  I  complain that   X  doesn't allow  advance positioning of  the
|> window, joe at etac632 says...
|> 
|>    -----------------------------------------------------------------------
|>   | There is an XSizeHints struct which includes the position and size. Be
|>   | sure to set the flags parameter to USPosition. The  helloworld program
|>   | in the "Introduction to the X Window System"  by Oliver Jones shows an
|>   | example of this which we used...
|>    -----------------------------------------------------------------------
|> 
|> I followed that same helloworld template, but somehow, when I modified
|> it to do images,  it  ceased to go  to where it was  supposed  to.   I
|> loaded up my XSizeHints as required...
|> 
|>   /**** set window position and size hints ****/
|>   xsh.flags = (PPosition | PSize);

It might help if you set the USPosition flag (reread what you were
instructed to do).

In any case, these are "hints" and not guaranteed to work.  For
instance, suppose I want my window manager to always let me position a
client window regardless of what the application developer wanted to
place it.  In X, it's possible to implement such a feature in a window
manager.

For this reason, X differentiates between user-specified positions
(USPosition) and program-specified positions (PPosition).  Window
managers are expected (but not forced) to honor user-specified
positions, but program-specified positions can be overriden.  For
instance, if the window manager tiles windows or if it's configured as
in my example.


|> but it simply ignored this "hint".  bernie at ecr.mu.oz.au (Bernie Kirby)
|> tells me that the secret is ...
|> 
|>   "you have to set the "override_redirect" thingy to True somewhere."

This works, but is not the solution.  Setting the override_redirect
attribute for a window is well-documented, and says that the window
manager should not get involved.  When this happens, of course your
window is placed where you wanted it.  But then, you can't do things
like iconify it or move it.

|> Well, this is likely to be the kind of thing that has to be  done.  Do
|> you see my complaint?  This kind of thing is typical of  X.  If it was
|> better designed,  the window position should either  be defined in the
|> window hints structure, or should  be a parameter to XCreateWindows().
|> In fact, you can be intimately familiar with  BOTH of these things and
|> STILL not be able to  position  your window because  you  haven't read
|> about the undocumented "override_redirect" thingy!   X is just full of
|> such hidden mysteries!  I don't  doubt that these  things can be  done
|> somehow, but I'm afraid you need a PhD in XOlogy to just open a window
|> and put an image in it!

You don't need a Ph.D.  Sometimes, you just have to read the manual.

-----------------------------------------------------------------------
                 Mike Yang        Silicon Graphics, Inc.
               mikey at sgi.com           415/335-1786



More information about the Comp.sys.sgi mailing list