Subject: bug#38452: 26.3; set-frame-position is slightly drifted

From: martin rudalics <[email-masked]>
Date: Tue, 3 Dec 2019 10:40:41 +0100

Pascal, thanks for replying.  I quote your mail in full below so it
appears that way on the bug tracker.  Please always use "reply to all"
when answering, so none of your mails get lost.

> When I does
> (set-frame-position nil 0 0)
> the frame jump to the left topmost point of the avalaible screen not
> counting the dock (which on my gnome-3 desktop is on the left side) neither the
> main menu line.
> If I repeat that command the frame does not move.
>
> But in that situation I get the evaluations:
> (frame-parameter nil 'left) ==> 45
> (frame-parameter nil 'top)  ==>  19
>
> Now if I evaluate (set-frame-position nil 45 19)
> the frame does not move (comparing with putting the frame at (0,0))
> and the parameters left and top keep unchanged values 45 and 19
>
> If now I evaluate:
>
> (set-frame-position nil 100 60)
> (frame-parameter nil 'left)
> (frame-parameter nil 'top)
> I get the values 90 and 52 for left and top.
>
> If reconfigure gnome so that the dock  appears on the bottom of
> my screen instead of the left edge, then
> (set-frame-position nil 0 0)
> moves the frame on the leftmost position of the screen and
> (frame-parameter nil 'left) ==> (+ -10)

 From this I conclude that the dock should be responsible for the
behavior you see.  Which window manager do you use?  What do you get
when you evaluate (display-monitor-attributes-list) in Emacs?  Are
there differences in the workarea values when you evaluate that
expression with the dock on the left and at the bottom?

Also you say that

(set-frame-position nil 0 0)

and

(set-frame-position nil 45 19)

both put the frame at the same position on the screen and in both
cases the following evaluations result:

(frame-parameter nil 'left) ==> 45
(frame-parameter nil 'top)  ==>  19

Is my reading of your text right?  If so, then the "problems" seem to
start when the X-value is somewhere between 45 and 100 and the Y-value
between 19 and 60.  Right?

Since the behavior apparently changes when you move the dock to the
bottom, the X-positioning seems clearly related to the position of the
dock.  Would the Y-positioning then be related to the presence of the
main menu line (presumably on the bottom)?  The one thing that
stupefies me then in either case is why the deviations are 10 and 8
pixels only.  I presume that both, your dock and the menu line, are
wider.

Thanks, martin