From: Eli Zaretskii Date: Wed, 4 May 2022 09:04:53 +0000 (+0300) Subject: Fix restoring desktop from TTY-saved sessions X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~16^2~2370^2~72 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b4acb1807b7044739bfd07143aee1433e87a25d4;p=emacs.git Fix restoring desktop from TTY-saved sessions * lisp/frameset.el (frameset-restore): Don't override/fix position of the restored frames for which we have geometry information saved by a past GUI session. (Bug#55070) --- diff --git a/lisp/frameset.el b/lisp/frameset.el index 34572000de9..23847a74a32 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -1309,9 +1309,14 @@ All keyword parameters default to nil." (setq mb-window nil))) (when mb-window (push (cons 'minibuffer mb-window) frame-cfg)))))) - (when (frameset-switch-to-gui-p frame-cfg) - ;; Apply small offsets to each frame, so that they - ;; don't obscure each other. + ;; Apply small offsets to each frame that came from + ;; a TTY-saved desktop, so that they don't obscure + ;; each other, but only if we don't have real frame + ;; position infor from a GUI session in some, + ;; possibly distant, past. + (when (and (frameset-switch-to-gui-p frame-cfg) + (null (cdr (assq 'GUI:top frame-cfg))) + (null (cdr (assq 'GUI:left frame-cfg)))) (setq dx (+ dx 20) dy (+ dy 10))) ;; OK, we're ready at last to create (or reuse) a frame and