Subject: Re: bug#65840: 29.1; desktop-load moves frames to the right and down

From: Gerd Möllmann <[email-masked]>
Date: Wed, 13 Sep 2023 20:51:43 +0200

Christian Tanzer via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

> On 13.09.2023, at 06:09, Gerd Möllmann <[email-masked]> wrote:
>> 
>> I guess this wasn't with emacs -Q, or was it?
>
> No, it wasn’t.
>
> And with -Q the frame positions are restored correctly.

Ok, thanks.

> There is still the question why Emacs 29 behaves differently then 28
> or earlier in my environment and shifts the frames upon desktop-read.
>
> Any hints what I should look for in my elisp code in this regard?

Not really, I'm afraid.  Maybe someone else has an idea?

The usual way I find out where something this comes from is a binary
search: disable half of your configuration, and see if the bug is still
there.  If yes, the bug is in the half that's still present.  And so
on...

Maybe a variant of the zsh script below could be helpful for that.  I
wrote it for this bug report to check the behavior of different Emacs
versions on different platforms.

#! /usr/bin/env zsh

emacs=(~/emacs/29/src/emacs -Q)

save_desktop=(--eval '(desktop-save ".")')
read_desktop=(--eval '(desktop-read ".")')
print=(--eval "(print (frame-position (selected-frame)) #'external-debugging-output)")
kill=(--eval '(kill-emacs)')

rm -f .emacs.desktop
$emacs -Q $save_desktop $print $kill
$emacs -Q $read_desktop $print $kill

The script prints the frame position before saving a desktop, and after
restoring it.