]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix setting of 'width' and 'height' frame parameters
authorMartin Rudalics <rudalics@gmx.at>
Wed, 5 May 2021 16:36:00 +0000 (18:36 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Wed, 5 May 2021 16:36:00 +0000 (18:36 +0200)
* src/frame.c (Fframe_parameters): Fix bogus setting of 'height'
and 'width' parameters.

src/frame.c

index d884a6d8b9658dc6b938ce315eb6b5d83b54ef49..738bfe9a5c8f91e3a35c85e7fab8fb0837eb002e 100644 (file)
@@ -3295,12 +3295,15 @@ If FRAME is omitted or nil, return information on the currently selected frame.
   /* It's questionable whether here we should report the value of
      f->new_height (and f->new_width below) but we've done that in the
      past, so let's keep it.  Note that a value of -1 for either of
-     these means that no new size was requested.  */
-  height = (f->new_height >= 0
+     these means that no new size was requested.
+
+     But check f->new_size before to make sure that f->new_height and
+     f->new_width are not ones requested by adjust_frame_size.  */
+  height = ((f->new_size_p && f->new_height >= 0)
            ? f->new_height / FRAME_LINE_HEIGHT (f)
            : FRAME_LINES (f));
   store_in_alist (&alist, Qheight, make_fixnum (height));
-  width = (f->new_width >= 0
+  width = ((f->new_size_p && f->new_width >= 0)
           ? f->new_width / FRAME_COLUMN_WIDTH (f)
           : FRAME_COLS(f));
   store_in_alist (&alist, Qwidth, make_fixnum (width));