Subject: bug#16574: 24.3.50; icon not shown on the splash screen (mac osx)

From: Darren Hoo <[email-masked]>
Date: Wed, 29 Jan 2014 07:52:11 +0800

On Tue, Jan 28, 2014 at 11:50 PM, Eli Zaretskii <[email-masked]> wrote:

> > Date: Tue, 28 Jan 2014 12:54:46 +0800
> > From: Darren Hoo <[email-masked]>
> > Cc: [email-masked]
> >
> > > I don't think this is a bug, and AFAIK it has been like this for some
> time.
> > > The image is not shown if the frame seems to be too small.
> > > See use-fancy-splash-screens-p.
> > >
> >
> > OK, I see.
> > Though use-fancy-splash-screens-p is not strictly correct on this.
> > If  I force it to use splash screen:
> >
> > (defun use-fancy-splash-screens-p () t)
> >
> > And examine these values of the splash screen on the initial startup
> > frame:
> >
> > (window-pixel-height)
> >  => 476
> >
> > (cdr (window-text-pixel-size
> >       (selected-window) nil nil nil nil t)) ; include mode-line
> >  => 462
> >
> > it has plenty room for display.
>
> How do you deduce that this is enough?

I can see that on my system the splash screen fits the frame quite well
in one page.

window-text-pixel-size (462) above returns the height of the text
displayed,
that counts the height of the splash image and the window-pixel-height
is 476 > 462, both inludes the height of the modeline.

> splash.xpm needs 217 pixels on
> my system, and use-fancy-splash-screens-p reserves 19 more lines for
> text, which on my system need 19 x 16 = 304 more pixels.  The sum is
> greater than either 462 or 476, so it sounds to me like

Which  splash file on your system is actually used for display?

The problem is that use-fancy-splash-screens-p uses splash.xpm to
determine the image height which  is 217 pixel high, while on my system
splash.png (188 pixel high) is actually  used (since it's more fancier
than the xpm one).

I think it's better for  use-fancy-splash-screens-p and fancy-splash-head
to use  the same file:

=== modified file 'lisp/startup.el'

--- lisp/startup.el 2014-01-01 07:43:34 +0000

+++ lisp/startup.el 2014-01-28 23:09:37 +0000

@@ -1590,24 +1590,28 @@

 (declare-function image-size "image.c" (spec &optional pixels frame))

+

+(defun fancy-splash-file ()

+  (cond ((stringp fancy-splash-image)

+ fancy-splash-image)

+ ((display-color-p)

+ (cond ((<= (display-planes) 8)

+ (if (image-type-available-p 'xpm)

+     "splash.xpm"

+   "splash.pbm"))

+       ((or (image-type-available-p 'svg)

+     (image-type-available-p 'imagemagick))

+ "splash.svg")

+       ((image-type-available-p 'png)

+ "splash.png")

+       ((image-type-available-p 'xpm)

+ "splash.xpm")

+       (t "splash.pbm")))

+ (t "splash.pbm")))

+

 (defun fancy-splash-head ()

   "Insert the head part of the splash screen into the current buffer."

-  (let* ((image-file (cond ((stringp fancy-splash-image)

-     fancy-splash-image)

-   ((display-color-p)

-     (cond ((<= (display-planes) 8)

-   (if (image-type-available-p 'xpm)

-       "splash.xpm"

-     "splash.pbm"))

-   ((or (image-type-available-p 'svg)

-       (image-type-available-p 'imagemagick))

-   "splash.svg")

-   ((image-type-available-p 'png)

-   "splash.png")

-   ((image-type-available-p 'xpm)

-   "splash.xpm")

-   (t "splash.pbm")))

-   (t "splash.pbm")))

+  (let* ((image-file (fancy-splash-file))

  (img (create-image image-file))

  (image-width (and img (car (image-size img))))

  (window-width (window-width)))

@@ -1805,22 +1809,16 @@

 (defun use-fancy-splash-screens-p ()

   "Return t if fancy splash screens should be used."

-  (when (and (display-graphic-p)

-             (or (and (display-color-p)

-       (image-type-available-p 'xpm))

-                 (image-type-available-p 'pbm)))

-    (let ((frame (fancy-splash-frame)))

-      (when frame

- (let* ((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 nil frame))))

-       ;; We test frame-height so that, if the frame is split

-       ;; by displaying a warning, that doesn't cause the normal

-       ;; splash screen to be used.

-       (frame-height (1- (frame-height frame))))

-   (> frame-height (+ image-height 19)))))))

+  (and (display-graphic-p)

+       (let ((frame (fancy-splash-frame)))

+ (when frame

+   (let* ((img (create-image (fancy-splash-file)))

+   (image-height (and img (cdr (image-size img nil frame))))

+   ;; We test frame-height so that, if the frame is split

+   ;; by displaying a warning, that doesn't cause the normal

+   ;; splash screen to be used.

+   (frame-height (1- (frame-height frame))))

+     (> frame-height (+ image-height 19)))))))

 (defun normal-splash-screen (&optional startup concise)