(0,0) placement of new windows - sometimes

Ivan Skytte Jørgensen isj-nedit at i1.dk
Wed Oct 3 23:39:19 CEST 2007


On Wednesday 03 October 2007 21:46, Ivan Skytte Jørgensen wrote:
> On Tuesday 02 October 2007 23:19, Scott Tringali wrote:
> > Ivan Skytte Jørgensen wrote:
> > > It is always "program specified location: 0, 0" on my machine. Even on
> > > the correctly placed windows. I just checked on another machine. Same
> > > problem with kde3.5.5/no-xinerama
> >
> > It might be a race between - I put a purported fix into CVS.
> >
> > That fixed the "program specified location: 0, 0" showing up when it
> > shouldn't.  But, I didn't ever see the wrong placement, so I don't know
> > if it helps.
...

I tried nedit on my own X11-software, and was unable to recreate the problem 
there. But the timing and window manager are completely different from 
x.org+kwin.

I have a theory, but need verification by someone who really knows about X and 
Motif.

When just starting nedit without any files, the initial window is created and 
the call flow is something like this:

1: EditNewFile()
   ...
2:   CreateWindow()
3      (presumably XMapWindow in the deep inside Motif)
4:     UpdateWMSizeHints()
5:       XtVaSetValues()
6:       RemovePPositionHint()
7:         XGetWMNormalHints()
8:         XSetWMNormalHints()

The window manager gets the MapWindow operation somewhere in (3) redirected to 
it. If the window manager is a bit slow and first gets around to reparenting 
the window after (5) but before (8) then the window is at position (0,0) with 
PPosition hint set, and therefore the window manager places the window at 
(0,0).

The comment in window.c line 2933 is unclear:
    /* Motif will keep placing this on the shell every time we change it,
       so it needs to be undone every single time.  This only seems to
       happen on mult-head dispalys on screens 1 and higher. */


I don't understand _what_ in Motif sets the program-specified-position bit in 
the wm_normal_hints property. Is it the XtVaSetValues() call that does this?


BTW: The "only happens on multi-head" is wrong. It happens on single-head too.


More information about the Discuss mailing list