[comp.windows.x] xterm windows height/width reported as height-1/width-1

casey@gauss.llnl.gov (Casey Leedom) (02/07/90)

  I never received a response to this, so I'm trying again.  The R4 xterm
saves height-1 and width-1 instead of height and width that the R3 xterm
saved.  This causes uwm and xplaces to under report the size of xterms by
one in each dimension.  I notice that twm does report the size
correctly.  What's the story?  Is this new ICCCM behavior?  In other
words, which are wrong: uwm/xplaces or xterm/twm?  I assume the former,
but I'd like some confirmation before I go and patch uwm and xplaces to
work properly.

Casey

casey@gauss.llnl.gov (Casey Leedom) (02/07/90)

  After much hassling through the uwm source code and comparing it with
the [roughly] equivalent twm code, I thought I found what the problem was
with it reporting the wrong row/column sizes for xterms: it wasn't
checking for PBaseSize and was always using PMinSize in order to try to
find out what the working area of the window really was (never mind --
it's an ICCCM behavior issue -- I'm just priming the well here.)  But
after making this little ICCM compliance fix, still no go.

  After several hours of staring blindly at the twm and uwm code and
trying to convince myself that there must be some difference between them
because twm worked and uwm didn't I started looking at the library
routines twm and uwm used to get the window size hints.  Or, rather, I
looked at what uwm was using and ran right into the problem.

  Uwm uses XGetSizeHints.  XGetSizeHints masks of all the flags it gets
back from the server except (USPosition|USSize|PAllHints).  It turns out
that PAllHints doesn't include PBaseSize (or PWinGravity for that
matter).  Why doesn't PAllHints include PBaseSize???  Is this a bug??  If
it isn't a bug, how should uwm be getting hints that include PBaseSize?

Not a happy puppy,
Casey

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (02/07/90)

    XGetSizeHints masks of all the flags it gets back from the server except
    (USPosition|USSize|PAllHints).  It turns out that PAllHints doesn't
    include PBaseSize (or PWinGravity for that matter).

XGetSizeHints is now a compatibility routine (check the R4 Xlib manual),
it still returns only the information that was in R3, not any of the new
ICCCM info.

    Why doesn't PAllHints include PBaseSize???  Is this a bug??

PAllHints is obsolete in R4.  Adding new values to it could break
source compatibility for old code.  PAllHints was left with its R3
definition by design.

    If it isn't a bug, how should uwm be getting hints that include PBaseSize?

uwm should be thrown away.  But failing that, uwm should be calling
XGetWMSizeHints instead.

colas@modja.inria.fr (Colas Nahaboo) (02/08/90)

In article <47569@lll-winken.LLNL.GOV>, casey@gauss.llnl.gov (Casey
Leedom) writes:
> 
>   I never received a response to this, so I'm trying again.  The R4 xterm
> saves height-1 and width-1 instead of height and width that the R3 xterm
> saved.  This causes uwm and xplaces to under report the size of xterms by
> one in each dimension.  I notice that twm does report the size
> correctly.  What's the story?  Is this new ICCCM behavior?

Yes, if you do a xprop on a R4 xterm, you see:

WM_NORMAL_HINTS(WM_SIZE_HINTS):
                user specified size: 578 by 340
                program specified size: 578 by 340
                program specified minimum size: 25 by 18
                program specified resize increment: 7 by 14
                program specified base size: 18 by 4

old (R3) WMs and clients use the "minimum size", but new (R4) WMs and
clients use the new ICCCM property "base size" for calculating the "logical"
size (pixel size  =  logical size  x  increment  + base size)

Moral: R3 WMs will give incorrect sizes for R4 clients.
One more reason to trash uwm :-)

Colas NAHABOO       BULL Research FRANCE -- Koala Project 
                    (GWM X11 Window Manager)  (colas@mirsa.inria.fr)

casey@GAUSS.LLNL.GOV (Casey Leedom) (02/08/90)

| From: rws@expo.lcs.mit.edu (Bob Scheifler)
| 
|     If it isn't a bug, how should uwm be getting hints that include
|     PBaseSize?
| 
| uwm should be thrown away.  But failing that, uwm should be calling
| XGetWMSizeHints instead.

  Thanks you, thank you, thank you!  I know that uwm should be thrown
away, but I have to install X.V11R4 for use by more than a hundred
people.  If I don't provide [mostly] working uwm and awm window managers
I'll spend the next six months answering the same questions over and over
and over and over and ...  The fact that uwm doesn't highlight xterm
windows will probably cause everyone to switch to twm.

  By the way, it would have been nice if twm had come with a couple more
functions in order to help people convert from uwm.  Things like
f.pushleft, f.pushright, f.pushup, f.pushdown and f.newiconify (although
I'll bet I just haven't figured out how to implement f.newiconify with
twm.)

Casey