Subject: Re: bug#60585: 30.0.50; global-text-scale-adjust shrinks window (was not before), was: Re: bug#52493: 29.0.50; Setting Inconsolata up in init.el makes default face rendered wrong

From: Dmitry Gutov <[email-masked]>
Date: Sun, 12 Feb 2023 00:08:52 +0200

On 11/02/2023 12:22, Po Lu via Bug reports for GNU Emacs, the Swiss army 
knife of text editors wrote:
> Dmitry Gutov <[email-masked]> writes:
> 
>> On 11/02/2023 03:36, Po Lu via Bug reports for GNU Emacs, the Swiss
>> army knife of text editors wrote:
>>> Whenever you see an inconsistency between what Emacs thinks its WM hints
>>> are, and what you think the window manager sees, try to actually read
>>> the window manager hints property with `xprop'.
>>> It should print several lines describing the window manager hints.
>>> WM_NORMAL_HINTS(WM_SIZE_HINTS):
>>> 		program specified minimum size: 34 by 55
>>> 		program specified resize increment: 8 by 17 <------
>>> 		program specified base size: 34 by 55
>>> 		window gravity: NorthWest
>>> Check there to see if the increment is really 17x37.
>>> Xt sometimes refuses to set hints, which can be very confusing.
>>
>> Thanks!
>>
>> Lucid's hints with InconsolataLGC:
>>
>> WM_NORMAL_HINTS(WM_SIZE_HINTS):
>> 		user specified size: 1714 by 1723
>> 		program specified minimum size: 51 by 140
>> 		program specified resize increment: 17 by 37
>> 		program specified base size: 51 by 140
>> 		window gravity: NorthWest
> 
> I guess the Lucid build is working correctly.
> 
>> GTK's hints with InconsolataLGC:
>>
>> WM_NORMAL_HINTS(WM_SIZE_HINTS):
>> 		program specified minimum size: 64 by 324
>> 		program specified resize increment: 16 by 36
>> 		program specified base size: 64 by 168
>> 		window gravity: NorthWest
>>
>> GTK's hints with "Inconsolata LGC" are the same, though:
>>
>> WM_NORMAL_HINTS(WM_SIZE_HINTS):
>> 		program specified minimum size: 64 by 324
>> 		program specified resize increment: 16 by 36
>> 		program specified base size: 64 by 168
>> 		window gravity: NorthWest
> 
> Thanks.
> 
> Would you please instrument emacsgtkfixed.c like such:
> 
> diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
> index 2b6ebee65fd..24aaf134dd2 100644
> --- a/src/emacsgtkfixed.c
> +++ b/src/emacsgtkfixed.c
> @@ -178,6 +178,9 @@ XSetWMSizeHints (Display *d,
>   	 data[5] = w;
>   	 data[6] = h; */
>   
> +      fprintf (stderr, "XSetWMSizeHints: %d, %d\n", hints->width_inc,
> +	       hints->height_inc);
> +
>         /* Make sure min_width and min_height are multiples of width_inc
>   	 and height_inc.  */
>   
> and tell me what is printed when Emacs begins to shrink?

Apply it on top of the already patched Emacs, correct? The one I've been 
running most of the tests lately.

During startup, it prints:

XSetWMSizeHints: 2, 2
XSetWMSizeHints: 18, 36
XSetWMSizeHints: 18, 36
XSetWMSizeHints: 18, 36

After I evaluate (set-face-attribute ...), it adds:

XSetWMSizeHints: 20, 44
XSetWMSizeHints: 16, 36
XSetWMSizeHints: 16, 36

After that, whenever the same evaluation results in frame shrinking 
(after I resized it with a mouse), it also prints

XSetWMSizeHints: 16, 36

That's it.

But if I repeat the same experiment using the value of :family 
"Inconsolata LGC" (with a space), it prints exactly the same values.

Except, since no s-f-a evaluations with that :family cause frame 
shrinking, it doesn't print any additional XSetWMSizeHints logs.