aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2013-07-27 03:02:00 +0200
committerJuanma Barranquero2013-07-27 03:02:00 +0200
commitd85c4d508105431699fc200135a14bfa7d86c0d7 (patch)
treea96c333d11673c341dd1226b55347ad3e8e4a87e
parent742a3501a0ded5aa65780592ffa5159f32b8bba7 (diff)
downloademacs-d85c4d508105431699fc200135a14bfa7d86c0d7.tar.gz
emacs-d85c4d508105431699fc200135a14bfa7d86c0d7.zip
lisp/desktop.el: Restore frames at their positions, even if offscreen.
(desktop--make-frame): Apply most frame parameters after creating the frame to force (partially or totally) offscreen frames to be restored as such.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/desktop.el24
2 files changed, 23 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9f0fdddc574..42ad403583b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12013-07-27 Juanma Barranquero <lekktu@gmail.com>
2
3 * desktop.el (desktop--make-frame): Apply most frame parameters after
4 creating the frame to force (partially or totally) offscreen frames to
5 be restored as such.
6
12013-07-26 Xue Fuqiao <xfq.free@gmail.com> 72013-07-26 Xue Fuqiao <xfq.free@gmail.com>
2 8
3 * vc/vc-dir.el (vc-dir-mode-map): Add binding for vc-root-diff. 9 * vc/vc-dir.el (vc-dir-mode-map): Add binding for vc-root-diff.
@@ -15,7 +21,7 @@
152013-07-26 Juanma Barranquero <lekktu@gmail.com> 212013-07-26 Juanma Barranquero <lekktu@gmail.com>
16 22
17 * desktop.el (desktop--select-frame): 23 * desktop.el (desktop--select-frame):
18 Try harder to reuse the initial frame. 24 Try harder to reuse existing frames.
19 25
202013-07-26 Stefan Monnier <monnier@iro.umontreal.ca> 262013-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
21 27
diff --git a/lisp/desktop.el b/lisp/desktop.el
index d5895a8de57..297f09b269e 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1311,14 +1311,22 @@ its window state. Internal use only."
1311 (push visible alt-cfg) 1311 (push visible alt-cfg)
1312 (push (cons 'fullscreen fullscreen) alt-cfg))) 1312 (push (cons 'fullscreen fullscreen) alt-cfg)))
1313 1313
1314 ;; Time to select or create a frame an apply the big bunch of parameters 1314 ;; Time to find or create a frame an apply the big bunch of parameters.
1315 (if (setq frame (desktop--select-frame display filtered-cfg)) 1315 ;; If a frame needs to be created and it falls partially or wholly offscreen,
1316 (modify-frame-parameters frame 1316 ;; sometimes it gets "pushed back" onscreen; however, moving it afterwards is
1317 (if (eq (frame-parameter frame 'fullscreen) fullscreen) 1317 ;; allowed. So we create the frame as invisible and then reapply the full
1318 ;; Workaround for bug#14949 1318 ;; parameter list (including position and size parameters).
1319 (assq-delete-all 'fullscreen filtered-cfg) 1319 (setq frame (or (desktop--select-frame display filtered-cfg)
1320 filtered-cfg)) 1320 (make-frame-on-display display
1321 (setq frame (make-frame-on-display display filtered-cfg))) 1321 (cons '(visibility)
1322 (cl-loop
1323 for param in '(left top width height)
1324 collect (assq param filtered-cfg))))))
1325 (modify-frame-parameters frame
1326 (if (eq (frame-parameter frame 'fullscreen) fullscreen)
1327 ;; Workaround for bug#14949
1328 (assq-delete-all 'fullscreen filtered-cfg)
1329 filtered-cfg))
1322 1330
1323 ;; Let's give the finishing touches (visibility, tool-bar, maximization). 1331 ;; Let's give the finishing touches (visibility, tool-bar, maximization).
1324 (when lines (push lines alt-cfg)) 1332 (when lines (push lines alt-cfg))