GNU bug report logs - #63187
30.0.50; Tail of longer lines painted after end of nearby lines on macOS

Previous Next

Package: emacs;

Reported by: Aaron Jensen <aaronjensen <at> gmail.com>

Date: Sun, 30 Apr 2023 10:11:01 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Aaron Jensen <aaronjensen <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Po Lu <luangruo <at> yahoo.com>, Alan Third <alan <at> idiocy.org>, 63187 <at> debbugs.gnu.org
Subject: bug#63187: 30.0.50; Tail of longer lines painted after end of nearby lines on macOS
Date: Mon, 8 May 2023 23:07:00 -0400
On Mon, May 1, 2023 at 9:47 AM Aaron Jensen <aaronjensen <at> gmail.com> wrote:
>
> On Mon, May 1, 2023 at 9:24 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > > From: Po Lu <luangruo <at> yahoo.com>
> > > Cc: aaronjensen <at> gmail.com,  63187 <at> debbugs.gnu.org
> > > Date: Mon, 01 May 2023 21:18:31 +0800
> > >
> > > Eli Zaretskii <eliz <at> gnu.org> writes:
> > >
> > > >> Cc: 63187 <at> debbugs.gnu.org
> > > >> Date: Mon, 01 May 2023 07:58:26 +0800
> > > >> From:  Po Lu via "Bug reports for GNU Emacs,
> > > >>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> > > >>
> > > >> Aaron Jensen <aaronjensen <at> gmail.com> writes:
> > > >>
> > > >> > Is there anything specific to macOS that is involved in scrolling optimization?
> > > >>
> > > >> Yes, Apple deleted the API used to perform bit blits, so Emacs uses a
> > > >> workaround that I don't really understand, and seems unreliable.
> > > >
> > > > You mean, ns_scroll_run in nsterm.m?  Which parts of it do you not
> > > > understand?
> > >
> > > No, I meant the implementation of [EmacsView copyRect:] enabled under
> > > Mac OS; see line 8655 of nsterm.m.  I don't understand how the system
> > > synchronizes its access to the window's backing store with Emacs's.
> >
> > Alan, can you help?
> >
> > If this is unworkable on macOS, we could simply disable this
> > optimization there.  But note that scroll_run_hook is also called from
> > xdisp.c, in several places, so we may need to disable it there as
> > well.
>
> Is this suspect?
>
>   {
>     NSRect srcRect = NSMakeRect (x, from_y, width, height);
>     NSPoint dest = NSMakePoint (x, to_y);
>     EmacsView *view = FRAME_NS_VIEW (f);
>
>     [view copyRect:srcRect to:dest];
> #ifdef NS_IMPL_COCOA
>     [view setNeedsDisplayInRect:srcRect];
> #endif
>   }
>
> Why is the source being marked for redisplay? I would expect the
> destination to be marked as such, or am I missing something?

It's not definitive, because it's always been intermittent, but I have
not seen the issue once since making this change a week ago. I'll give
it another week or two, but it certainly hasn't caused any problems
and may be worth considering for 29 before it is released.

diff --git a/src/nsterm.m b/src/nsterm.m
index ecbf80ff72d..310d2bd81c7 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2704,11 +2704,12 @@ Hide the window (X11 semantics)
   {
     NSRect srcRect = NSMakeRect (x, from_y, width, height);
     NSPoint dest = NSMakePoint (x, to_y);
+    NSRect destRect = NSMakeRect (x, from_y, width, height);
     EmacsView *view = FRAME_NS_VIEW (f);

     [view copyRect:srcRect to:dest];
 #ifdef NS_IMPL_COCOA
-    [view setNeedsDisplayInRect:srcRect];
+    [view setNeedsDisplayInRect:destRect];
 #endif
   }

Aaron




This bug report was last modified 1 year and 364 days ago.

Previous Next


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