Subject: Re: 31.0.50; Change in fit-frame-to-buffer doesn't work with transient-posframe

From: Gerd Möllmann <[email-masked]>
Date: Wed, 14 May 2025 16:24:28 +0200

Gerd Möllmann <[email-masked]> writes:

> (defun transient--fit-window-to-buffer (window)
>   (set-window-parameter window 'window-preserved-size nil)
>   (let ((fit-window-to-buffer-horizontally t)
>         (window-resize-pixelwise t)
>         (window-size-fixed nil))
>     (cond ((not (window-parent window))
>            (fit-frame-to-buffer (window-frame window) nil nil nil
>                                 transient-minimal-frame-width))
>           ((eq (car (window-parameter window 'quit-restore)) 'other)
>            ;; Grow but never shrink window that previously displayed
>            ;; another buffer and is going to display that again.
>            (fit-window-to-buffer window nil (window-height window)))
>           ((fit-window-to-buffer window nil 1))))
>   (set-window-parameter window 'window-preserved-size
>                         (list (window-buffer window)
>                               (window-body-width window t)
>                               (window-body-height window t))))
>
> Should that have bound frame-resize-pixelwise? And if so why? I think I
> understand more or less what the doc string of that variable says, but
> the transient doesn't have anything I recognize that would make
> pixel-wise resizing necessary. Or is some internal border or something?
> Sorry, I'm in unknown territory here.

When I add a binding for frame-resize-pixelwise, things seem to work on
the GUI, BTW.