Fix restoring desktop from TTY-saved sessions
authorEli Zaretskii <eliz@gnu.org>
Wed, 4 May 2022 09:04:53 +0000 (12:04 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 4 May 2022 09:04:53 +0000 (12:04 +0300)
* 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)

lisp/frameset.el

index 34572000de90e7d6269f8d675627cc37904f82fb..23847a74a32bbee86744f17768689e12522f3f07 100644 (file)
@@ -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