Subject: bug#16013: 24.3.50; Rows in height is interpreted as pixels.

From: martin rudalics <[email-masked]>
Date: Wed, 04 Dec 2013 19:06:26 +0100

> Lucid/Motif: 46 rows, 74 columns on initial frame,
 >             50 rows, 80 columns on subsequent frames.

I don't know which libraries are needed to build with Lucid.  I
installed open motif libraries but the build script doesn't appreciate
them.  So I can't test these here.  At least the "subsequent frames"
look correct.

 > No toolkit: 45 rows, 68 columns on initial frame,
 >                  47 rows, 75 columns on subsequent frames.

This can be fixed here using the attached patch.  But with a frame width
of 60 the echo area should resize but disappears on the initial frame.
I don't yet know why.

 > Gtk+3 and 2: 49 rows, 80 columns on initial frame.
 >                 49 rows, 80 columns on subsequent frames.

martin
=== modified file 'src/xterm.c'
--- src/xterm.c	2013-12-03 11:33:13 +0000
+++ src/xterm.c	2013-12-04 16:37:35 +0000
@@ -8552,12 +8552,15 @@
 
   compute_fringe_widths (f, 0);
 
-  pixelwidth =
-    (pixelwise ? width : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width))
-    + FRAME_TOOLBAR_WIDTH (f);
-  pixelheight =
-    (pixelwise ? height : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height))
-    + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
+  pixelwidth = ((pixelwise
+		 ? FRAME_TEXT_TO_PIXEL_WIDTH (f, width)
+		 : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width))
+		+ FRAME_TOOLBAR_WIDTH (f));
+  pixelheight = ((pixelwise
+		  ? FRAME_TEXT_TO_PIXEL_HEIGHT (f, height)
+		  : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height))
+		 + FRAME_MENUBAR_HEIGHT (f)
+		 + FRAME_TOOLBAR_HEIGHT (f));
 
   if (change_gravity) f->win_gravity = NorthWestGravity;
   x_wm_set_size_hint (f, (long) 0, 0);
@@ -8593,8 +8596,6 @@
   else
     {
       change_frame_size (f, width, height, 0, 1, 0, 1);
-      FRAME_PIXEL_WIDTH (f) = pixelwidth;
-      FRAME_PIXEL_HEIGHT (f) = pixelheight;
       x_sync (f);
     }
 }