summaryrefslogtreecommitdiff
path: root/lisp/startup.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-07-02 18:23:26 +0000
committerRichard M. Stallman <rms@gnu.org>2002-07-02 18:23:26 +0000
commit6b20fb8e166082db9d7ad9ef0c01518023075e68 (patch)
tree41627a275413906ebc8725d30eb3ee1b8ccd86a4 /lisp/startup.el
parentdf1890b0d7979304280560fc3dd5b81f1b426442 (diff)
downloademacs-6b20fb8e166082db9d7ad9ef0c01518023075e68.tar.gz
(fancy-splash-screens): Switch to a chosen frame.
(fancy-splash-frame): Choose the right frame to use. (use-fancy-splash-screens-p): Check dimensions of the right frame in order to decide.
Diffstat (limited to 'lisp/startup.el')
-rw-r--r--lisp/startup.el68
1 files changed, 42 insertions, 26 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index 3d6217f8505..23942e531b0 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1260,46 +1260,62 @@ where FACE is a valid face specification, as it can be used with
(fancy-splash-outer-buffer (current-buffer))
splash-buffer
(old-minor-mode-map-alist minor-mode-map-alist)
+ (frame (fancy-splash-frame))
timer)
- (switch-to-buffer "GNU Emacs")
- (setq tab-width 20)
- (setq splash-buffer (current-buffer))
- (catch 'stop-splashing
- (unwind-protect
- (let ((map (make-sparse-keymap)))
- (use-local-map map)
- (define-key map [t] 'fancy-splash-default-action)
- (define-key map [mouse-movement] 'ignore)
- (define-key map [mode-line t] 'ignore)
- (setq cursor-type nil
- display-hourglass nil
- minor-mode-map-alist nil
- buffer-undo-list t
- mode-line-format (propertize "---- %b %-"
- 'face '(:weight bold))
- fancy-splash-stop-time (+ (float-time)
- (max 60 fancy-splash-max-time))
- timer (run-with-timer 0 fancy-splash-delay
- #'fancy-splash-screens-1
- splash-buffer))
- (recursive-edit))
+ (save-selected-window
+ (select-frame frame)
+ (switch-to-buffer "GNU Emacs")
+ (setq tab-width 20)
+ (setq splash-buffer (current-buffer))
+ (catch 'stop-splashing
+ (unwind-protect
+ (let ((map (make-sparse-keymap)))
+ (use-local-map map)
+ (define-key map [switch-frame] 'ignore)
+ (define-key map [t] 'fancy-splash-default-action)
+ (define-key map [mouse-movement] 'ignore)
+ (define-key map [mode-line t] 'ignore)
+ (setq cursor-type nil
+ display-hourglass nil
+ minor-mode-map-alist nil
+ buffer-undo-list t
+ mode-line-format (propertize "---- %b %-"
+ 'face '(:weight bold))
+ fancy-splash-stop-time (+ (float-time)
+ (max 60 fancy-splash-max-time))
+ timer (run-with-timer 0 fancy-splash-delay
+ #'fancy-splash-screens-1
+ splash-buffer))
+ (recursive-edit))
(cancel-timer timer)
(setq display-hourglass old-hourglass
minor-mode-map-alist old-minor-mode-map-alist)
- (kill-buffer splash-buffer)))))
-
+ (kill-buffer splash-buffer))))))
+
+(defun fancy-splash-frame ()
+ "Return the frame to use for the fancy splash screen.
+Returning non-nil does not mean we should necessarily
+use the fancy splash screen, but if we do use it,
+we put it on this frame."
+ (let (chosen-frame)
+ (dolist (frame (frame-list))
+ (if (and (frame-visible-p frame)
+ (not (window-minibuffer-p (frame-selected-window frame))))
+ (setq chosen-frame frame)))
+ chosen-frame))
(defun use-fancy-splash-screens-p ()
"Return t if fancy splash screens should be used."
(when (or (and (display-color-p)
(image-type-available-p 'xpm))
(image-type-available-p 'pbm))
- (let* ((img (create-image (or fancy-splash-image
+ (let* ((frame (fancy-splash-frame))
+ (img (create-image (or fancy-splash-image
(if (and (display-color-p)
(image-type-available-p 'xpm))
"splash.xpm" "splash.pbm"))))
(image-height (and img (cdr (image-size img))))
- (window-height (1- (window-height (selected-window)))))
+ (window-height (1- (window-height (frame-selected-window frame)))))
(> window-height (+ image-height 19)))))