GNU bug report logs - #48157
Emacs-28 on Mac: corrupted GUI when setting default-frame-alist

Previous Next

Package: emacs;

Reported by: PEDRO ANDRES ARANDA GUTIERREZ <paranda <at> it.uc3m.es>

Date: Sun, 2 May 2021 10:38:02 UTC

Severity: normal

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48157 in the body.
You can then email your comments to 48157 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#48157; Package emacs. (Sun, 02 May 2021 10:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to PEDRO ANDRES ARANDA GUTIERREZ <paranda <at> it.uc3m.es>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 02 May 2021 10:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: PEDRO ANDRES ARANDA GUTIERREZ <paranda <at> it.uc3m.es>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs-28 on Mac: corrupted GUI when setting default-frame-alist
Date: Sun, 2 May 2021 12:37:29 +0200
[Message part 1 (text/plain, inline)]


Hi 

Just tested compiling emacs con macOS Catalina.

My .emacs.d/init includes 

(setq default-frame-alist '((top . 32 ) (left . 32) (width . 128) (height . 37)))

The result is this:


With the mini-buffer line hidden. If I comment this line, the GUI is created correctly. The window rebuild correctly if I resize it with the mouse

Configured using:
 'configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
 LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include CC=clang
 OBJC=clang 'CFLAGS=-g -O3'
 LIBXML2_CFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2
 LIBXML2_LIBS=-lxml2'

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

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

Major mode: Lisp Interaction

Minor modes in effect:
  global-tab-line-mode: t
  tab-line-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  shell-dirtrack-mode: t
  electric-pair-mode: t
  show-paren-mode: t
  override-global-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/Users/paag/.emacs.d/lisp/rst hides /Applications/Emacs.app/Contents/Resources/lisp/textmodes/rst

Features:
(shadow sort flyspell ispell mail-extr emacsbug message rmc puny dired
dired-loaddefs rfc822 mml mml-sec epa epg epg-config gnus-util rmail
rmail-loaddefs text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils multiple-cursors
mc-hide-unmatched-lines-mode mc-separate-operations
rectangular-region-mode mc-mark-pop mc-mark-more thingatpt
mc-cycle-cursors mc-edit-lines multiple-cursors-core rect server
ob-python python tramp-sh ob-ditaa ox-odt rng-loc rng-uri rng-parse
rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok
nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox
org-element org ob ob-tangle ob-ref ob-lob ob-table org-macro
org-footnote org-src ob-comint org-pcomplete org-list org-faces
org-entities noutline outline org-version ob-emacs-lisp org-table
org-keys org-loaddefs find-func cal-menu calendar cal-loaddefs avl-tree
generator ol ob-exp ob-core org-compat advice ob-eval org-macs
silkworm-theme tab-line pcase indent-tools yafolding hydra lv
indent-tools-indentation-of synctex-mac texlog-mode derived texlog
yasnippet cl-extra help-mode tramp tramp-loaddefs trampver
tramp-integration files-x tramp-compat shell pcomplete comint ansi-color
ring parse-time iso8601 time-date ls-lisp format-spec hl-line elec-pair
track-change paren cus-edit pp cus-load wid-edit use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core finder-inf
info edmacro kmacro package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar
mouse jit-lock font-lock syntax font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice button loaddefs faces
cus-face macroexp files window text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote threads kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 212017 12721)
 (symbols 48 21953 7)
 (strings 32 76003 4845)
 (string-bytes 1 2495205)
 (vectors 16 36484)
 (vector-slots 8 403682 11441)
 (floats 8 124 105)
 (intervals 56 387 0)
 (buffers 992 12))

—
PEDRO ANDRES ARANDA GUTIERREZ
paranda <at> it.uc3m.es
Universidad Carlos III Madrid

Fragen sind nicht da um beantwortet zu werden…
Fragen sind da, um gestellt zu werden.
Georg Kreisler



[Message part 2 (text/html, inline)]
[Image.png (image/png, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48157; Package emacs. (Sun, 02 May 2021 11:40:01 GMT) Full text and rfc822 format available.

Message #8 received at 48157 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: PEDRO ANDRES ARANDA GUTIERREZ <paranda <at> it.uc3m.es>
Cc: 48157 <at> debbugs.gnu.org
Subject: Re: bug#48157: Emacs-28 on Mac: corrupted GUI when setting
 default-frame-alist
Date: Sun, 2 May 2021 12:39:23 +0100
On Sun, May 02, 2021 at 12:37:29PM +0200, PEDRO ANDRES ARANDA GUTIERREZ wrote:
> Just tested compiling emacs con macOS Catalina.
> 
> My .emacs.d/init includes 
> 
> (setq default-frame-alist '((top . 32 ) (left . 32) (width . 128) (height . 37)))
> 
> The result is this:
> 
> 
> With the mini-buffer line hidden. If I comment this line, the GUI is
> created correctly. The window rebuild correctly if I resize it with
> the mouse

Can you please try pulling the latest changes down, there have been a
few modifications to frame resizing code just today, so hopefully they
might fix this. If not, can you work out roughly when this problem
started? For example, was it there before commit a190b4cfd8?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48157; Package emacs. (Sun, 02 May 2021 16:18:01 GMT) Full text and rfc822 format available.

Message #11 received at 48157 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: PEDRO ANDRES ARANDA GUTIERREZ <paranda <at> it.uc3m.es>, 48157 <at> debbugs.gnu.org
Subject: Re: bug#48157: Emacs-28 on Mac: corrupted GUI when setting
 default-frame-alist
Date: Sun, 2 May 2021 18:17:29 +0200
> Just tested compiling emacs con macOS Catalina.
>
> My .emacs.d/init includes
>
> (setq default-frame-alist '((top . 32 ) (left . 32) (width . 128) (height . 37)))
>
> The result is this:
>
>
> With the mini-buffer line hidden. If I comment this line, the GUI is created correctly. The window rebuild correctly if I resize it with the mouse

Please try the patch below.

Thanks, martin


diff --git a/src/nsterm.m b/src/nsterm.m
index 6e7ab1266b..b089146e64 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7310,9 +7310,9 @@ - (void)viewDidResize:(NSNotification *)notification

   /* Don't want to do anything when the view size hasn't changed. */
   if ((oldh == newh && oldw == neww)
-      || (emacsframe->new_size_p
-          && newh == emacsframe->new_height
-          && neww == emacsframe->new_width))
+      && (!emacsframe->new_size_p
+          || (newh == emacsframe->new_height
+	      && neww == emacsframe->new_width)))
     {
       NSTRACE_MSG ("No change");
       return;




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48157; Package emacs. (Mon, 03 May 2021 06:50:02 GMT) Full text and rfc822 format available.

Message #14 received at 48157 <at> debbugs.gnu.org (full text, mbox):

From: PEDRO ANDRES ARANDA GUTIERREZ <paranda <at> it.uc3m.es>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 48157 <at> debbugs.gnu.org
Subject: Re: bug#48157: Emacs-28 on Mac: corrupted GUI when setting
 default-frame-alist
Date: Mon, 3 May 2021 08:49:21 +0200
[Message part 1 (text/plain, inline)]
HI,

I retried a couple of minutes ago and it continues to startup weirdly on my
MacBook Air

Darwin paag-MacBookAir 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12
22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 x86_64

The same code compiled on my pre-2015 McBook Pro (macOS 10.13) works
perfectly on both systems.

Best, /PA

El dom, 2 may 2021 a las 18:17, martin rudalics (<rudalics <at> gmx.at>)
escribió:

>  > Just tested compiling emacs con macOS Catalina.
>  >
>  > My .emacs.d/init includes
>  >
>  > (setq default-frame-alist '((top . 32 ) (left . 32) (width . 128)
> (height . 37)))
>  >
>  > The result is this:
>  >
>  >
>  > With the mini-buffer line hidden. If I comment this line, the GUI is
> created correctly. The window rebuild correctly if I resize it with the
> mouse
>
> Please try the patch below.
>
> Thanks, martin
>
>
> diff --git a/src/nsterm.m b/src/nsterm.m
> index 6e7ab1266b..b089146e64 100644
> --- a/src/nsterm.m
> +++ b/src/nsterm.m
> @@ -7310,9 +7310,9 @@ - (void)viewDidResize:(NSNotification *)notification
>
>     /* Don't want to do anything when the view size hasn't changed. */
>     if ((oldh == newh && oldw == neww)
> -      || (emacsframe->new_size_p
> -          && newh == emacsframe->new_height
> -          && neww == emacsframe->new_width))
> +      && (!emacsframe->new_size_p
> +          || (newh == emacsframe->new_height
> +             && neww == emacsframe->new_width)))
>       {
>         NSTRACE_MSG ("No change");
>         return;
>


-- 
---
PEDRO ANDRES ARANDA GUTIERREZ
Universidad Carlos III de Madrid

"Fragen sind nicht da um beantwortet zu werden.
Fragen sind da, um gestellt zu werden" Georg Kreisler
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#48157; Package emacs. (Mon, 03 May 2021 07:57:02 GMT) Full text and rfc822 format available.

Message #17 received at 48157 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: PEDRO ANDRES ARANDA GUTIERREZ <paranda <at> it.uc3m.es>
Cc: 48157 <at> debbugs.gnu.org
Subject: Re: bug#48157: Emacs-28 on Mac: corrupted GUI when setting
 default-frame-alist
Date: Mon, 3 May 2021 09:56:45 +0200
[Message part 1 (text/plain, inline)]
> I retried a couple of minutes ago and it continues to startup weirdly on my
> MacBook Air

Did you try Alan's latest fixes (I attach them here)?

martin
[0001-Fix-incorrect-resizing-behaviour-on-macOS-bug-48157-.patch (text/x-patch, attachment)]

Reply sent to Alan Third <alan <at> idiocy.org>:
You have taken responsibility. (Mon, 03 May 2021 17:50:02 GMT) Full text and rfc822 format available.

Notification sent to PEDRO ANDRES ARANDA GUTIERREZ <paranda <at> it.uc3m.es>:
bug acknowledged by developer. (Mon, 03 May 2021 17:50:02 GMT) Full text and rfc822 format available.

Message #22 received at 48157-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: PEDRO ANDRES ARANDA GUTIERREZ <paranda <at> it.uc3m.es>
Cc: 48157-done <at> debbugs.gnu.org
Subject: Re: bug#48157: Emacs-28 on Mac: corrupted GUI when setting
 default-frame-alist
Date: Mon, 3 May 2021 18:49:13 +0100
Thanks!

On Mon, May 03, 2021 at 06:52:36PM +0200, PEDRO ANDRES ARANDA GUTIERREZ wrote:
> Confirmed that the currect version with the patch applied works in High Sierra and Catalina :-)
> 
> Best, /PA
> 
> > El 3 may 2021, a las 13:19, Alan Third <alan <at> idiocy.org> escribió:
> > 
> > On Mon, May 03, 2021 at 11:49:54AM +0200, PEDRO ANDRES ARANDA GUTIERREZ wrote:
> >> So... I have just compiled and tested on the Catalina Air and it draws the
> >> screen correctly :-)
> >> 
> >> Do you need me to check on the 10.13 MacBook pro too?
> > 
> > If you could it would be helpful, as 10.13 and below use a slightly
> > different mechanism, although given it works in GNUstep, it should
> > work in 10.13.
> > 
> > Thanks!
> 
> —
> PEDRO ANDRES ARANDA GUTIERREZ
> paranda <at> it.uc3m.es
> Universidad Carlos III Madrid
> 
> Fragen sind nicht da um beantwortet zu werden…
> Fragen sind da, um gestellt zu werden.
> Georg Kreisler
> 

-- 
Alan Third




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Jun 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 328 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.