GNU bug report logs - #39724
26.3; Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6 breaks font display on macOS

Previous Next

Package: emacs;

Reported by: "John Wiegley" <johnw <at> gnu.org>

Date: Fri, 21 Feb 2020 21:46:02 UTC

Severity: normal

Found in version 26.3

Done: Stefan Kangas <stefan <at> marxist.se>

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 39724 in the body.
You can then email your comments to 39724 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#39724; Package emacs. (Fri, 21 Feb 2020 21:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "John Wiegley" <johnw <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 21 Feb 2020 21:46:02 GMT) Full text and rfc822 format available.

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

From: "John Wiegley" <johnw <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Cc: Alan Third <alan <at> idiocy.org>, Eli Zaretskii <eliz <at> gnu.org>
Subject: 26.3;
 Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6 breaks font display
 on macOS
Date: Fri, 21 Feb 2020 13:45:08 -0800
I noticed recently that no text was displaying in my Emacs 27 windows. As if
everything were black and black, except that changing the font and background
colors did not help.

It took two days of rebuilding, but I've isolated this as the breaking commit:

commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6
Author: Alan Third <alan <at> idiocy.org>
Date:   Sat Feb 1 21:17:29 2020 +0000

    Use CGImage instead of NSBitmapImageRep (bug#32932)

    * src/nsterm.m (ns_update_end):
    (ns_clear_frame): Remove forced draws.
    (ns_draw_fringe_bitmap):
    (ns_dumpglyphs_image): No longer need to invert images as the context
    is already flipped.
    ([EmacsView updateFrameSize:]):
    ([EmacsView initFrameFromEmacs:]): Use new function.
    ([EmacsView createDrawingBuffer]): Replaces createDrawingBufferWithRect:.
    ([EmacsView focusOnDrawingBuffer]): Set CGImage context.
    ([EmacsView windowDidChangeBackingProperties:]): Use new function.
    ([EmacsView copyRect:to:]): Copy using CGImages.
    ([EmacsView wantsUpdateLayer]):
    ([EmacsView updateLayer]): New Functions.
    ([EmacsView drawRect:]): We no longer do anything special here for
    Cocoa.
    ([EmacsView windowDidChangeBackingProperties:]): Fix indentation and
    add NSTRACE.

Anything prior to this works as expected. From this commit forward, all
windows are black on black.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39724; Package emacs. (Fri, 21 Feb 2020 22:51:01 GMT) Full text and rfc822 format available.

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

From: Alan Third <alan <at> idiocy.org>
To: bug-gnu-emacs <at> gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#39724: 26.3; Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6
 breaks font display on macOS
Date: Fri, 21 Feb 2020 22:50:14 +0000
On Fri, Feb 21, 2020 at 01:45:08PM -0800, John Wiegley wrote:
> I noticed recently that no text was displaying in my Emacs 27 windows. As if
> everything were black and black, except that changing the font and background
> colors did not help.
> 
> It took two days of rebuilding, but I've isolated this as the breaking commit:
> 
> commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6
> Author: Alan Third <alan <at> idiocy.org>
> Date:   Sat Feb 1 21:17:29 2020 +0000
> 
>     Use CGImage instead of NSBitmapImageRep (bug#32932)
> 
>     * src/nsterm.m (ns_update_end):
>     (ns_clear_frame): Remove forced draws.
>     (ns_draw_fringe_bitmap):
>     (ns_dumpglyphs_image): No longer need to invert images as the context
>     is already flipped.
>     ([EmacsView updateFrameSize:]):
>     ([EmacsView initFrameFromEmacs:]): Use new function.
>     ([EmacsView createDrawingBuffer]): Replaces createDrawingBufferWithRect:.
>     ([EmacsView focusOnDrawingBuffer]): Set CGImage context.
>     ([EmacsView windowDidChangeBackingProperties:]): Use new function.
>     ([EmacsView copyRect:to:]): Copy using CGImages.
>     ([EmacsView wantsUpdateLayer]):
>     ([EmacsView updateLayer]): New Functions.
>     ([EmacsView drawRect:]): We no longer do anything special here for
>     Cocoa.
>     ([EmacsView windowDidChangeBackingProperties:]): Fix indentation and
>     add NSTRACE.

Hi John, that commit isn’t in the emacs-27 branch, or if it is
something has gone terribly wrong.

> Anything prior to this works as expected. From this commit forward, all
> windows are black on black.

Zhang Haijun has reported something similar on the master branch. The
compile logs look as though there’s something wrong with his build
environment. What version of macOS are you using? Are there any errors
or warnings when you build it?
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39724; Package emacs. (Sun, 23 Feb 2020 21:00:02 GMT) Full text and rfc822 format available.

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

From: "John Wiegley" <johnw <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: eliz <at> gnu.org, 39724 <at> debbugs.gnu.org
Subject: Re: bug#39724: 26.3;
 Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6 breaks font display
 on macOS
Date: Sun, 23 Feb 2020 12:59:30 -0800
>>>>> "AT" == Alan Third <alan <at> idiocy.org> writes:

AT> Hi John, that commit isn’t in the emacs-27 branch, or if it is something
AT> has gone terribly wrong.

>> Anything prior to this works as expected. From this commit forward, all
>> windows are black on black.

You're right, I meant the master branch.

AT> Zhang Haijun has reported something similar on the master branch. The
AT> compile logs look as though there’s something wrong with his build
AT> environment. What version of macOS are you using? Are there any errors or
AT> warnings when you build it?

I'm using Catalina, let me capture the build log for you...

On a maybe related note, I now find that ERC is unusably slow: I can type
faster than Emacs can display the characters. Given that I've changed nothing
about my setup in past months, this could be related to other macOS changes.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39724; Package emacs. (Mon, 24 Feb 2020 09:46:01 GMT) Full text and rfc822 format available.

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

From: Alan Third <alan <at> idiocy.org>
To: bug-gnu-emacs <at> gnu.org,John Wiegley <johnw <at> gnu.org>
Cc: 39724 <at> debbugs.gnu.org
Subject: Re: bug#39724: 26.3;
 Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6 breaks font display
 on macOS
Date: Mon, 24 Feb 2020 10:45:23 +0100 (CET)
On 23 February 2020 20:59:30 GMT, John Wiegley <johnw <at> gnu.org> wrote:
>>>>>> "AT" == Alan Third <alan <at> idiocy.org> writes:
>
>AT> Zhang Haijun has reported something similar on the master branch.
>The
>AT> compile logs look as though there’s something wrong with his build
>AT> environment. What version of macOS are you using? Are there any
>errors or
>AT> warnings when you build it?
>
>I'm using Catalina, let me capture the build log for you...


Are you still using Nix to build Emacs? As I recall it used to use the 10.10 build environment even on more modern versions of macOS, so this could still be an incompatibility between the new drawing code and older versions of macOS/XCode.

-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39724; Package emacs. (Mon, 24 Feb 2020 09:46:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39724; Package emacs. (Mon, 24 Feb 2020 17:57:01 GMT) Full text and rfc822 format available.

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

From: John Wiegley <johnw <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: 39724 <at> debbugs.gnu.org
Subject: Re: bug#39724: 26.3;
 Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6 breaks font display
 on macOS
Date: Mon, 24 Feb 2020 09:56:04 -0800
>>>>> "AT" == Alan Third <alan <at> idiocy.org> writes:

AT> Are you still using Nix to build Emacs? As I recall it used to use the
AT> 10.10 build environment even on more modern versions of macOS, so this
AT> could still be an incompatibility between the new drawing code and older
AT> versions of macOS/XCode.

I am using Nix, but it passes this:

    -DMAC_OS_X_VERSION_MAX_ALLOWED=101200

Which should be recent enough, I'd think.

I also need to track down the slowness that I'm seeing, to see which commit
introduced that. It will take me a few days to gather all of this information,
given how slow the test cycles are.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39724; Package emacs. (Tue, 25 Feb 2020 21:07:01 GMT) Full text and rfc822 format available.

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

From: Alan Third <alan <at> idiocy.org>
To: John Wiegley <johnw <at> gnu.org>
Cc: 39724 <at> debbugs.gnu.org
Subject: Re: bug#39724: 26.3; Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6
 breaks font display on macOS
Date: Tue, 25 Feb 2020 22:06:33 +0100 (CET)
On Mon, Feb 24, 2020 at 09:56:04AM -0800, John Wiegley wrote:
> >>>>> "AT" == Alan Third <alan <at> idiocy.org> writes:
> 
> AT> Are you still using Nix to build Emacs? As I recall it used to use the
> AT> 10.10 build environment even on more modern versions of macOS, so this
> AT> could still be an incompatibility between the new drawing code and older
> AT> versions of macOS/XCode.
> 
> I am using Nix, but it passes this:
> 
>     -DMAC_OS_X_VERSION_MAX_ALLOWED=101200
> 
> Which should be recent enough, I'd think.
> 
> I also need to track down the slowness that I'm seeing, to see which commit
> introduced that. It will take me a few days to gather all of this information,
> given how slow the test cycles are.

Could you try the below patch to see if that sorts the background issue?

modified   src/nsterm.m
@@ -8240,6 +8240,8 @@ - (void)createDrawingBuffer
   /* This fixes the scale to match the backing scale factor, and flips the image.  */
   CGContextTranslateCTM(drawingBuffer, 0, NSHeight (frame) * scale);
   CGContextScaleCTM(drawingBuffer, scale, -scale);
+
+  ns_clear_frame (emacsframe);
 }
 
 
@@ -8269,7 +8271,6 @@ - (void)windowDidChangeBackingProperties:(NSNotification *)notification
     {
       NSRect frame = [self frame];
       [self createDrawingBuffer];
-      ns_clear_frame (emacsframe);
       expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
     }
 }


I don’t know if I’ve just missed it (I’ve been messing with my email
set‐up recently) but I’ve not seen the build log you promised.

-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39724; Package emacs. (Thu, 05 Mar 2020 17:23:01 GMT) Full text and rfc822 format available.

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

From: Alan Third <alan <at> idiocy.org>
To: John Wiegley <johnw <at> gnu.org>
Cc: 39724 <at> debbugs.gnu.org
Subject: Re: bug#39724: 26.3; Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6
 breaks font display on macOS
Date: Thu, 5 Mar 2020 18:22:10 +0100 (CET)
On Tue, Feb 25, 2020 at 10:06:33PM +0100, Alan Third wrote:
> On Mon, Feb 24, 2020 at 09:56:04AM -0800, John Wiegley wrote:
> > >>>>> "AT" == Alan Third <alan <at> idiocy.org> writes:
> > 
> > AT> Are you still using Nix to build Emacs? As I recall it used to use the
> > AT> 10.10 build environment even on more modern versions of macOS, so this
> > AT> could still be an incompatibility between the new drawing code and older
> > AT> versions of macOS/XCode.
> > 
> > I am using Nix, but it passes this:
> > 
> >     -DMAC_OS_X_VERSION_MAX_ALLOWED=101200
> > 
> > Which should be recent enough, I'd think.
> > 
> > I also need to track down the slowness that I'm seeing, to see which commit
> > introduced that. It will take me a few days to gather all of this information,
> > given how slow the test cycles are.
> 
> Could you try the below patch to see if that sorts the background issue?
> 
> modified   src/nsterm.m
> @@ -8240,6 +8240,8 @@ - (void)createDrawingBuffer
>    /* This fixes the scale to match the backing scale factor, and flips the image.  */
>    CGContextTranslateCTM(drawingBuffer, 0, NSHeight (frame) * scale);
>    CGContextScaleCTM(drawingBuffer, scale, -scale);
> +
> +  ns_clear_frame (emacsframe);
>  }
>  
>  
> @@ -8269,7 +8271,6 @@ - (void)windowDidChangeBackingProperties:(NSNotification *)notification
>      {
>        NSRect frame = [self frame];
>        [self createDrawingBuffer];
> -      ns_clear_frame (emacsframe);
>        expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
>      }
>  }
> 
> 
> I don’t know if I’ve just missed it (I’ve been messing with my email
> set‐up recently) but I’ve not seen the build log you promised.
> 

Hi John, I don’t know if you tried the above patch, but can you please
try building the master branch again? I fixed an issue last night that
may be the same as your problem. I’m not sure because it all depends
on the build environment and what versions of Cocoa are available and
so on, and I think Nix may confuse matters.

-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39724; Package emacs. (Mon, 24 Aug 2020 08:37:01 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Alan Third <alan <at> idiocy.org>
Cc: John Wiegley <johnw <at> gnu.org>, 39724 <at> debbugs.gnu.org
Subject: Re: bug#39724: 26.3; Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6
 breaks font display on macOS
Date: Mon, 24 Aug 2020 04:36:42 -0400
Alan Third <alan <at> idiocy.org> writes:

> On Tue, Feb 25, 2020 at 10:06:33PM +0100, Alan Third wrote:
>> On Mon, Feb 24, 2020 at 09:56:04AM -0800, John Wiegley wrote:
>> > >>>>> "AT" == Alan Third <alan <at> idiocy.org> writes:
>> >
>> > AT> Are you still using Nix to build Emacs? As I recall it used to use the
>> > AT> 10.10 build environment even on more modern versions of macOS, so this
>> > AT> could still be an incompatibility between the new drawing code and older
>> > AT> versions of macOS/XCode.
>> >
>> > I am using Nix, but it passes this:
>> >
>> >     -DMAC_OS_X_VERSION_MAX_ALLOWED=101200
>> >
>> > Which should be recent enough, I'd think.
>> >
>> > I also need to track down the slowness that I'm seeing, to see which commit
>> > introduced that. It will take me a few days to gather all of this information,
>> > given how slow the test cycles are.
>>
>> Could you try the below patch to see if that sorts the background issue?
>>
>> modified   src/nsterm.m
>> @@ -8240,6 +8240,8 @@ - (void)createDrawingBuffer
>>    /* This fixes the scale to match the backing scale factor, and flips the image.  */
>>    CGContextTranslateCTM(drawingBuffer, 0, NSHeight (frame) * scale);
>>    CGContextScaleCTM(drawingBuffer, scale, -scale);
>> +
>> +  ns_clear_frame (emacsframe);
>>  }
>>
>>
>> @@ -8269,7 +8271,6 @@ - (void)windowDidChangeBackingProperties:(NSNotification *)notification
>>      {
>>        NSRect frame = [self frame];
>>        [self createDrawingBuffer];
>> -      ns_clear_frame (emacsframe);
>>        expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
>>      }
>>  }
>>
>>
>> I don’t know if I’ve just missed it (I’ve been messing with my email
>> set‐up recently) but I’ve not seen the build log you promised.
>>
>
> Hi John, I don’t know if you tried the above patch, but can you please
> try building the master branch again? I fixed an issue last night that
> may be the same as your problem. I’m not sure because it all depends
> on the build environment and what versions of Cocoa are available and
> so on, and I think Nix may confuse matters.

That was 6 months ago.  Any updates here?

If I don't hear back from you within a couple of weeks, I'll just
assume this has been fixed and close this bug.

Best regards,
Stefan Kangas




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Thu, 01 Oct 2020 12:40:02 GMT) Full text and rfc822 format available.

Notification sent to "John Wiegley" <johnw <at> gnu.org>:
bug acknowledged by developer. (Thu, 01 Oct 2020 12:40:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Alan Third <alan <at> idiocy.org>
Cc: John Wiegley <johnw <at> gnu.org>, 39724-done <at> debbugs.gnu.org
Subject: Re: bug#39724: 26.3; Commit 44298ea6aa006ed227e539b02279bd3fc11fd2a6
 breaks font display on macOS
Date: Thu, 1 Oct 2020 05:38:53 -0700
Stefan Kangas <stefan <at> marxist.se> writes:

>> Hi John, I don’t know if you tried the above patch, but can you please
>> try building the master branch again? I fixed an issue last night that
>> may be the same as your problem. I’m not sure because it all depends
>> on the build environment and what versions of Cocoa are available and
>> so on, and I think Nix may confuse matters.
>
> That was 6 months ago.  Any updates here?
>
> If I don't hear back from you within a couple of weeks, I'll just
> assume this has been fixed and close this bug.

More information was requested, but none was given within 5 weeks, so
I'll just assume that the above fixed the issue.  I'm therefore closing
this bug now.

If this is still an issue, please reply to this email (use "Reply to
all" in your email client) and we can reopen the bug report.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 30 Oct 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 172 days ago.

Previous Next


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