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

From: martin rudalics <[email-masked]>
Date: Thu, 15 Oct 2015 11:59:49 +0200

I add a few observations from the GNUstep perspective.  This build is
inherently broken (emacs -Q starts out with _two_ identical tool bars)
but gets me similar results.  Anders what do you get when you repeat
Keith's experiment?  Only steps (1) and (2) make sense currently.

 > (1) Toggle the tool bar off.  Does the overall frame height shrink or stay the same?
 >
 > A: Starting from Emacs -Q.  Using the mouse to toggle the toolbar off,
 > the height of the frame shrinks -- i.e., top and left remain the same,
 > and the bottom shrinks upward about one-half the height of the toolbar
 > that disappears.  The minibuffer / echo area increases in size to
 > about 3 lines of text, with just one line of text that reads:
 > "menu-bar options showhide showhide-tool-bar".

This is more or less what happens here as well but worked previously.
IIUC it's due to Jan's change below:

diff --git a/src/ChangeLog b/src/ChangeLog
index 69da1c3..861ba91 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-06  Jan Djärv  <[email-masked]>
+
+	* nsterm.m (x_set_window_size): Call updateFrameSize to get real
+	size instead of using widht/height.  The frame may be constrained.
+
  2015-01-05  Paul Eggert  <[email-masked]>

  	* lisp.h (XSYMBOL): Parenthesize id in forward decl.
diff --git a/src/nsterm.m b/src/nsterm.m
index 2ccb7fe..bf3192b 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1404,15 +1404,8 @@ x_set_window_size (struct frame *f,
      [view setBoundsOrigin: origin];
    }

-  change_frame_size (f, width, height, 0, 1, 0, pixelwise);
-/*  SET_FRAME_GARBAGED (f); // this short-circuits expose call in drawRect */
-
-  mark_window_cursors_off (XWINDOW (f->root_window));
-  cancel_mouse_face (f);
-
+  [view updateFrameSize: NO];
    unblock_input ();
-
-  do_pending_window_change (0);
  }

Restoring the change_frame_size call fixes the problem here.

 > (2) Toggle the tool bar on again.  Does the overall frame height increase or stay the same?
 >

 > A: The frame height quickly shrinks and expands, but ultimately
 > remains the same size -- i.e., slightly less than when Emacs -Q first
 > began its GUI session.

More or less same here.  I tried with earlier builds and all show the
same behavior: Toggling the tool bar on and off repeatedly has the frame
height ultimately shrink.

 > (3) Evaluate (setq frame-inhibit-implied-resize t) and repeat steps (1) and (2).
 >

 > A: Starting again from Emacs -Q.  Evaluate `(setq
 > frame-inhibit-implied-resize t)`.  Step 1 looks the same as previously
 > reported.  Step 2 looks the same as previously reported.  I did not
 > see any visual difference between this test and prior test mentioned
 > above.

I'll try to fix this.  But we must fix (1) first, then (2) ...

Thanks, martin