[comp.windows.x] Placing a window under X11R4

bill@polygen.uucp (Bill Poitras) (09/15/90)

I am porting an X application from X11R3 to X11R4.  One of the problems
I am encountering is getting the top-level window to place itself without
the help of TWM.  I have looked in the ICCCM document, as well as the Xlib
documentation.  It seems that the XCreateWindow call should be sufficient
to place the window.  I use XSetWMHints and XSetNormalHints to set some
other hints.  Any help would greatly be appreciated.
+-----------------+---------------------------+-----------------------------+
| Bill Poitras    | Polygen Corporation       | {princeton mit-eddie        |
|     (bill)      | Waltham, MA USA           |  bu sunne}!polygen!bill     |
|                 |                           | bill@polygen.com            |
+-----------------+---------------------------+-----------------------------+

mouse@LARRY.MCRCIM.MCGILL.EDU (09/18/90)

> I am porting an X application from X11R3 to X11R4.  One of the
> problems I am encountering is getting the top-level window to place
> itself without the help of TWM.

This is entirely up to TWM.  If TWM decides that the user shall always
place new windows, your client really isn't in much position to argue
about it.  Some window managers can be told when to make the user place
the window; I don't know whether this is true of TWM or not.

In other words, you're trying to do this the wrong place.  It's not
something your client has control over; this is a window manager issue
and has to be dealt with as such.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

geg@beep.melb.semi.harris.com (Greg Garland) (09/18/90)

>>> I am porting an X application from X11R3 to X11R4.  One of the
>>> problems I am encountering is getting the top-level window to place
>>> itself without the help of TWM.

>This is entirely up to TWM.  If TWM decides that the user shall always
>place new windows, your client really isn't in much position to argue
>about it.  Some window managers can be told when to make the user place
>the window; I don't know whether this is true of TWM or not.

Hm... What about setting override_redirect to TRUE in the window attributes?
Doesn't this tell the window manager to bug off?

Greg G.

toml@ninja.Solbourne.COM (Tom LaStrange) (09/18/90)

|> > I am porting an X application from X11R3 to X11R4.  One of the
|> > problems I am encountering is getting the top-level window to place
|> > itself without the help of TWM.
|> 
|> This is entirely up to TWM.  If TWM decides that the user shall always
|> place new windows, your client really isn't in much position to argue
|> about it.  Some window managers can be told when to make the user place
|> the window; I don't know whether this is true of TWM or not.
|> 
|> In other words, you're trying to do this the wrong place.  It's not
|> something your client has control over; this is a window manager issue
|> and has to be dealt with as such.

twm will honor USPosition hints if they are set and will optionally honor
PPosition hints.  These flags are in the WM_NORMAL_HINTS property of the
XSizeHints structure.  USPosition should ONLY be set if the user requested
the position.  PPosition should be used to request a default window position
from within the program.

--
Tom LaStrange

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

toml@ninja.Solbourne.COM (Tom LaStrange) (09/19/90)

|> >>> I am porting an X application from X11R3 to X11R4.  One of the
|> >>> problems I am encountering is getting the top-level window to place
|> >>> itself without the help of TWM.
|> 
|> >This is entirely up to TWM.  If TWM decides that the user shall always
|> >place new windows, your client really isn't in much position to argue
|> >about it.  Some window managers can be told when to make the user place
|> >the window; I don't know whether this is true of TWM or not.
|> 
|> Hm... What about setting override_redirect to TRUE in the window attributes?
|> Doesn't this tell the window manager to bug off?

Yes, but it tells it to bug off so well that you won't be able to move,
resize, iconify, raise, lower, ...  the thing.

--
Tom LaStrange

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

dshr@eng.sun.COM (David Rosenthal) (09/19/90)

> Hm... What about setting override_redirect to TRUE in the window attributes?
> Doesn't this tell the window manager to bug off?
> 
Yes,  but you should not use it except under some very special
circumstances:

-	when other windows should be prevented from processing
	input while the override-redirect window is mapped (see
	ICCCM section 4.1.10), or

-	while responding to ResizeRequest events (see ICCCM section
	4.2.9).

Use of override-redirect under other circumstances is "strongly
discouraged" (see ICCCM section 4.2.2).

	David.

garyo@think.com (Gary Oberbrunner) (09/19/90)

In article <9009182036.AA12502@devnull.Eng.Sun.COM> dshr@eng.sun.COM (David
Rosenthal) writes:

   > Hm... What about setting override_redirect to TRUE in the window attributes?
   > Doesn't this tell the window manager to bug off?
   > 
   Yes,  but you should not use it except under some very special
   circumstances:

	<special circumstances edited...>

   Use of override-redirect under other circumstances is "strongly
   discouraged" (see ICCCM section 4.2.2).

	   David.

In my application I map a full-screen input-only window that I use to turn
the X mouse into a virtual trackball.  I certainly don't want the user to
have to "position" this invisible window.  So override-redirect is useful
in other cases as well as the two reported above.

				- Gary Oberbrunner
				Thinking Machines Corporation
				245 First St
				Cambridge, MA 02142
				garyo@think.com