]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix recent changes regarding frame-scale-factor
authorEli Zaretskii <eliz@gnu.org>
Sun, 4 Apr 2021 06:41:44 +0000 (09:41 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 4 Apr 2021 06:41:44 +0000 (09:41 +0300)
* src/frame.c (Fframe_scale_factor): Make more robust and avoid
compiler warning while at that.  Doc fix.

src/frame.c

index 784a079bffea1780d67fb1671b43ee7bdbd0dc42..bbdc3b55992e1eeab2f9e6e09d0be2802fd0f46f 100644 (file)
@@ -3747,13 +3747,13 @@ window state change flag is reset.  */)
 DEFUN ("frame-scale-factor", Fframe_scale_factor, Sframe_scale_factor,
        0, 1, 0,
        doc: /* Return FRAMEs scale factor.
-The scale factor is the amount a logical pixel size must be multiplied
-to find the real number of pixels.  */)
+The scale factor is the amount by which a logical pixel size must be
+multiplied to find the real number of pixels.  */)
      (Lisp_Object frame)
 {
   struct frame *f = decode_live_frame (frame);
 
-  return (make_float (FRAME_SCALE_FACTOR (f)));
+  return (make_float (f ? FRAME_SCALE_FACTOR (f) : 1));
 }
 \f
 /***********************************************************************