Subject: Re: bug#28442: 26.0.50; desktop-save-mode no longer restores correct frame size on macOS

From: Alan Third <[email-masked]>
Date: Wed, 22 Nov 2017 17:07:12 +0000

Aaron Jensen <[email-masked]> writes:

> After d31cd79b40dbd5459b16505a4ee4340210499277 is applied,
> desktop-save-mode will no longer restore frames on macOS to the proper
> size. They end up being slightly smaller in both height and width,
> meaning that repeated restarts will result in a shrinking frame.
>
> I don't know where the equivalent is in desktop.el, but when
> implementing my own version of restoring the frame position it was
> (before d31cd79b) necessary to slightly adjust frame height and width
> from the reported width when saving. I was able to remove this hack
> after d31cd79b: https://github.com/aaronjensen/restore-frame-position/commit/b89f85e145dd94922a74de60f2e8993c80874796
>
> Also note that even without d31cd79b, desktop-save-mode restores a
> height that is roughly 4px shy of the frames's actual height, but that
> may have something to do with a setting I have somewhere that allows my
> emacs frame height to not be snapped to text height--I don't remember
> what that setting is, however.

Hi Aaron, I think you want to use frame-text-width and frame-text-height
rather than frame-geometry-*.

frame-geometry-width returns the outer width of the frame, but the
functions for *setting* the width and height use the inner frame size,
which I think equates to the text area size.
-- 
Alan Third