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

From: Keith David Bershatsky <[email-masked]>
Date: Wed, 09 Sep 2015 17:46:51 -0700

The patch of `nsterm.m` has repaired much of the functionality of `frame-inhibit-implied-resize`.  The two tests that previously failed now work as expected:

     1.  From a maximized frame, I can change the `font` to Courier 18 using `set-face-attribute` and there is no need to set `frame-inhibit-implied-resize` in that circumstance.

     2.  From a frame that is smaller than the screen size, I can use `set-face-attribute` to change the font to Courier 18 provided that `frame-inhibit-implied-resize` is set to `t`.

The problem I am having is with a situation where `ns-auto-hide-menu-bar` is set to `t`.  As previously noted in this thread, the `top` frame parameter is ignored when making a new frame that is the size of the screen -- the new frame appears substantially above the top of the display -- i.e., one-half out of sight.  When the new frame is partially above the top of the screen, `set-face-attribute` substantially enlarges the frame even though `frame-inhibit-implied-resize` is set to `t`.  When the frame comes back into full view (e.g., top 0, left 0), it is then possible to apply `set-face-attribute` without altering the dimensions of the frame.  The following are two examples -- one example works, the other example is broken -- both rely upon `ns-auto-hide-menu-bar` being set to `t`.

(setq ns-auto-hide-menu-bar t)

;; WORKS
(let* (
    (frame-inhibit-implied-resize t)
    (frame
      (make-frame '(
         (vertical-scroll-bars)
         (left-fringe . 8)
         (right-fringe . 8)
         (width . 1259.0)
         (height . 771.0)
         (tool-bar-lines . 0)))) )
  (set-frame-position frame 0 0)
  (set-face-attribute 'default frame :font "-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1"))

;; BROKEN
(let* (
    (frame-inhibit-implied-resize t)
    (frame
      (make-frame '(
        (font . "-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1")
        (vertical-scroll-bars)
        (left-fringe . 8)
        (right-fringe . 8)
        (width . 1259.0)
        (height . 771.0)
        (tool-bar-lines . 0)))) )
  (set-frame-position frame 0 0))