Subject: bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-frame

From: martin rudalics <[email-masked]>
Date: Wed, 09 Sep 2015 19:11:18 +0200

> Step 1:  M-x toggle-frame-maximized
 >
 > Step 2 [evaluate]:  (set-face-attribute 'default nil :font "-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1")
 >
 > RESULT:  The frame substantially increases in size, going from maximized to extending well beyond the right edge of the screen.

That's bad.  Please try the attached patch (completely untested, might
crash your Emacs).

martin
diff --git a/src/nsterm.m b/src/nsterm.m
index e90c3d7..196c30b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7612,8 +7612,9 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
 
   /* Now make the frame display the given font.  */
   if (FRAME_NS_WINDOW (f) != 0 && ! [view isFullscreen])
-    x_set_window_size (f, false, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
-                       FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), true);
+    adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+		       FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3,
+		       false, Qfont);
 
   return font_object;
 }