Subject: Re: bug#74750: clone-frame and make-frame pixelwise issues

From: martin rudalics <[email-masked]>
Date: Wed, 11 Dec 2024 10:37:57 +0100

> Somewhere in the bowels
 > of frame.c, et.al., is an issue where text-pixels behaves differently than
 > set-frame-size which is reliable on NS where make-frame using text-pixels
 > is incorrect by the vertical scroll bar width. GTK it's off, too, but I
 > didn't analyze that further.

If you mean that with

(progn
   (setq frame-resize-pixelwise t)
   (make-frame '((width . (text-pixels . 800)))))

then

(frame-text-width)

evaluates to 784, please try the attached patch.

Thanks, martin

diff --git a/src/frame.c b/src/frame.c
index f6053fca3ef..4c21ce5b51b 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -168,8 +168,10 @@ frame_inhibit_resize (struct frame *f, bool horizontal, Lisp_Object parameter)
 	  || (!horizontal
 	      && !NILP (fullscreen) && !EQ (fullscreen, Qfullwidth))
 	  || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
-       : ((horizontal && f->inhibit_horizontal_resize)
-	  || (!horizontal && f->inhibit_vertical_resize)));
+     : ((horizontal && f->inhibit_horizontal_resize
+	 && !EQ (parameter, Qscroll_bar_width))
+	|| (!horizontal && f->inhibit_vertical_resize
+	    && !EQ (parameter, Qscroll_bar_height))));
 
   return inhibit;
 }