Subject: bug#55410: 28.1; Button text is sometimes trimmed in the NS port

From: Daniel Martín <[email-masked]>
Date: Sat, 14 May 2022 13:29:05 +0200

Steps to reproduce:

emacs -Q
C-x C-f foo
Type something
Click on the upper-left red button to close the frame.

Actual result:

The text "Close Without Saving" is trimmed.

Expected result:

The text of all buttons is completely visible.

I think this bug happens whenever the button text is longer than the
minimum button width (MINCELLWIDTH in nsmenu.m).

I've taken a look at the code and I can avoid the problem if I remove
the expression [cell setBezelStyle: NSBezelStyleRounded] from the
NSButtonCell preparation code in [EmacsDialogPanel
initWithContentRect:styleMask:backing:defer].  But, of course, buttons
look ugly if I do that.

In GNU Emacs 28.1 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559))
 of 2022-04-04 built on armbob.lan
Windowing system distributor 'Apple', version 10.3.2113
System Description:  macOS 12.3.1

Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp' --with-modules'

Configured features:
ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER THREADS
TOOLKIT_SCROLL_BARS ZLIB

Important settings:
  value of $LANG: en_ES.UTF-8
  locale-coding-system: utf-8-unix