summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-05-04 12:04:53 +0300
committerEli Zaretskii <eliz@gnu.org>2022-05-04 12:04:53 +0300
commitb4acb1807b7044739bfd07143aee1433e87a25d4 (patch)
treeabdd8bcdfc6c39bdcf3849b32328851930666136
parent0105a4ddb8a58146f3fc71c265e57291c873af0b (diff)
downloademacs-b4acb1807b7044739bfd07143aee1433e87a25d4.tar.gz
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)
-rw-r--r--lisp/frameset.el11
1 files changed, 8 insertions, 3 deletions
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