emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

incorrect correspondence in frame parameter values (left and top)


From: Drew Adams
Subject: incorrect correspondence in frame parameter values (left and top)
Date: Sat, 27 Nov 2004 13:08:29 -0800

This is a bit hard to describe, but it's really straightforward.

According to the doc, the frame parameter values (left + -N) and (left . M)
should have identical meaning, where M = display-pixel-width -
frame-pixel-width - N. Likewise, for frame parameter top. However, the
meanings are not the same for such values. In my Windows version of Emacs,
what should be identical frame positions differ by 12 pixels.

Do this:

1. Position a new frame at the left border (the position isn't important,
but keep track of the position you use - using 0 makes it easier). Evaluate
(assq 'left (frame-parameters nil)), getting, for example, (left . 0).

2. Measure the frame width in pixels: (frame-pixel-width nil), getting, for
example, 600.

3. Measure the display width in pixels: (display-pixel-width nil), getting,
for example, 1280.

4. Calculate the distance of the frame's right edge from the display's right
edge, getting, for example, 1280 - 600 = 680.

5. Change the frame's left parameter to the negation of the value in #4, for
example: (modify-frame-parameters nil '((left . -680))). According to the
doc, this positions the right edge of the frame 680 pixels from the right
edge of the display.

The frame should not have moved, because its right edge being 680 pixels
from the display right edge is the same as its left edge being 0 pixels from
the display left edge. The left frame parameter should now be either (left
. -680), as it was set, or one of its equivalents: (left . 0), (left + 0),
or (left - 680).

However the frame has in fact shifted 12 pixels to the left. And when you
check the left frame parameter, you see this (and the value you set relative
to the right edge has been changed to a value relative to the left): (assq
'left (frame-parameters nil)) gives, for example, (left + -12). This
parameter value is incorrect.

AFAICS, the same shift happens regardless of the starting frame position and
size, and it happens for parameter top as well as for left. Also, showing or
hiding scroll bars has no effect on the pb.

This bug has fairly serious consequences for code that tries to position,
move, or resize frames. For example, it makes certain tiling operations
problematic.

Thanks,

  Drew

In GNU Emacs 21.3.50.1 (i386-mingw-nt5.1.2600)
 of 2004-07-26 on BERATUNG4
configured using `configure --with-gcc
(3.3) --cflags -I../../jpeg-6b-1/include -I../../libpng-1.2.4-1/include -I..
/../tiff-3.5.7/include -I../../xpm-nox-4.2.0/include -I../../zlib-1.1.4-1/in
clude'





reply via email to

[Prev in Thread] Current Thread [Next in Thread]