unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Aaron Jensen <aaronjensen@gmail.com>
Cc: Po Lu <luangruo@yahoo.com>, Kai Ma <justksqsf@gmail.com>,
	Eli Zaretskii <eliz@gnu.org>,
	63187@debbugs.gnu.org
Subject: bug#63187: 30.0.50; Tail of longer lines painted after end of nearby lines on macOS
Date: Fri, 9 Jun 2023 21:00:19 +0100	[thread overview]
Message-ID: <ZIOE02wGf0ZAghfq@idiocy.org> (raw)
In-Reply-To: <CAHyO48y+xaxr9CyROLSsbF6F8Sq3q92Bs1uesHWB8JDAgO_U-g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1882 bytes --]

On Fri, Jun 09, 2023 at 02:46:29PM -0400, Aaron Jensen wrote:
> On Fri, Jun 9, 2023 at 2:27 PM Alan Third <alan@idiocy.org> wrote:
> > It seems to me that removing the call to performSelectorOnMainThread
> > should be done. That may even fix Aaron's original issue too, given
> > that I don't know why calling setNeedsDisplayInRect twice in a row
> > should help, especially given it's not actually used anywhere else in
> > the display code.
> 
> How is it called twice? Does copyRect mark for redisplay?

Sorry, I had misunderstood your change.

Either way, I don't see how it's made a difference.
setNeedsDisplayInRect is telling the system which parts it needs to
call drawRect on, but we don't use drawRect any more, so I would think
all it can be doing is setting the needsDisplay boolean to true.

copyRect definitely doesn't do anything with the rectangle. It deals
with the bitmap's pixel data directly, so there's no clipping or
anything else affecting it and it's changes don't need to be
committed to some backing store.

Even when it comes to actually displaying the view on the screen, we
pass in the entire bitmap to the graphics subsystem and it
(supposedly) displays it in it's entirety.

So as I understand it the rectangle passed into setNeedsDisplayInRect
doesn't do anything. I think that call in ns_scroll_run was left there
by mistake. It's literally the only call to it in the entire nsterm.m
file.

But you report that it has fixed your problem. I can't explain that
because it runs counter to my understanding of how macOS draws.

But then again, none of this is documented in any in-depth way by
Apple, so who knows what's REALLY going on.

Patch attached, but it's untested. It may even make things worse. I'm
happy to leave it up to you to decide what to do since you're in a
better position to tell if any given change actually helps.
-- 
Alan Third

[-- Attachment #2: 0001-Reduce-graphical-glitches-in-certain-circumstances-o.patch --]
[-- Type: text/x-diff, Size: 1524 bytes --]

From b34cd84c1b070248b396d2ec82018be99b529d31 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Fri, 9 Jun 2023 20:53:31 +0100
Subject: [PATCH] Reduce graphical glitches in certain circumstances on macOS
 (bug#63187)

* src/nsterm.m (ns_scroll_run): Change way we request the frame is
redrawn to the glass-we no longer invalidate regions.
([EmacsLayer display]): Get rid of this asynchronous call, it may be
causing unexpected glitches during rapid updates.
---
 src/nsterm.m | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index 3e089cc1ff1..673fdf31531 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -2708,8 +2708,9 @@ Hide the window (X11 semantics)
     EmacsView *view = FRAME_NS_VIEW (f);
 
     [view copyRect:srcRect to:dest];
-#ifdef NS_IMPL_COCOA
-    [view setNeedsDisplayInRect:destRect];
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+    /* I don't know if we even need this...  */
+    [view setNeedsDisplay:YES];
 #endif
   }
 
@@ -10633,12 +10634,6 @@ - (void) display
       /* Put currentSurface back on the end of the cache.  */
       [cache addObject:(id)currentSurface];
       currentSurface = NULL;
-
-      /* Schedule a run of getContext so that if Emacs is idle it will
-         perform the buffer copy, etc.  */
-      [self performSelectorOnMainThread:@selector (getContext)
-                             withObject:nil
-                          waitUntilDone:NO];
     }
 }
 
-- 
2.39.1


  reply	other threads:[~2023-06-09 20:00 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2fs8histt.fsf@gmail.com>
2023-04-30 10:33 ` bug#63187: 30.0.50; Tail of longer lines painted after end of nearby lines on macOS Eli Zaretskii
2023-04-30 10:46   ` Aaron Jensen
2023-04-30 13:25 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-30 14:25   ` Aaron Jensen
2023-04-30 14:42     ` Eli Zaretskii
2023-04-30 14:57       ` Aaron Jensen
2023-04-30 15:26         ` Eli Zaretskii
2023-04-30 16:48           ` Aaron Jensen
2023-04-30 19:04             ` Eli Zaretskii
2023-04-30 23:58     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-01 12:40       ` Eli Zaretskii
2023-05-01 13:18         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-01 13:25           ` Eli Zaretskii
2023-05-01 13:47             ` Aaron Jensen
2023-05-01 13:52               ` Eli Zaretskii
2023-05-01 13:55                 ` Aaron Jensen
2023-05-01 14:06                   ` Aaron Jensen
2023-05-09  3:07               ` Aaron Jensen
2023-05-09  5:39                 ` Eli Zaretskii
2023-05-13 13:54                   ` Eli Zaretskii
2023-05-13 14:23                     ` Aaron Jensen
2023-05-18 11:21                       ` Eli Zaretskii
2023-05-18 15:59                         ` Aaron Jensen
2023-06-08  5:40                           ` Kai Ma
2023-06-08  7:33                             ` Kai Ma
2023-06-08 12:51                               ` Alan Third
2023-06-08 13:42                                 ` Kai Ma
2023-06-08 14:57                                   ` Kai Ma
2023-06-08 17:22                                     ` Alan Third
2023-06-09  2:42                                       ` Kai Ma
2023-06-09  2:47                                         ` Aaron Jensen
2023-06-09  3:12                                           ` Kai Ma
2023-06-09 18:27                                             ` Alan Third
2023-06-09 18:46                                               ` Aaron Jensen
2023-06-09 20:00                                                 ` Alan Third [this message]
2023-06-12 13:04                                                   ` Aaron Jensen
2023-06-16  2:17                                                     ` Aaron Jensen
2023-06-19 15:46                                                       ` Aaron Jensen
2023-06-24  4:17                                                         ` Kai Ma
2023-06-24 13:34                                                           ` Aaron Jensen
2023-06-24 14:14                                                             ` Alan Third
2023-06-24 14:52                                                               ` Aaron Jensen
2023-06-24 15:08                                                                 ` Eli Zaretskii
2023-06-24 15:41                                                                 ` Alan Third
2023-06-24 16:05                                                                   ` Aaron Jensen
2023-06-24 21:29                                                                     ` Alan Third
2023-06-24 21:43                                                                       ` Aaron Jensen
2023-06-25 12:46                                                                         ` Alan Third
2023-06-25 17:07                                                                           ` Aaron Jensen
2023-06-25 18:17                                                                             ` Alan Third
2023-06-25 19:07                                                                               ` Aaron Jensen
2023-06-25 21:18                                                                                 ` Alan Third
2023-06-25 22:33                                                                                   ` Aaron Jensen
2023-06-26  7:27                                                                           ` Kai Ma
2023-06-28 19:53                                                                             ` Alan Third
2023-07-21  2:02                                                                               ` Aaron Jensen
2023-07-23 11:20                                                                                 ` Alan Third
2023-07-23 13:01                                                                                   ` Aaron Jensen
2023-07-25 14:47                                                                                     ` Aaron Jensen
2023-07-25 15:45                                                                                       ` Eli Zaretskii
2023-06-23  8:48                                                       ` Alan Third
2023-06-23 11:54                                                         ` Aaron Jensen
2023-05-01 17:26             ` Alan Third
2023-05-01 22:40               ` Aaron Jensen
2023-05-02 10:14                 ` Alan Third
2023-05-02 12:21                   ` Eli Zaretskii
2023-05-02 22:36                     ` Alan Third
2023-05-03  8:11                       ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-03 13:08                       ` Eli Zaretskii
2023-05-02  0:07               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-02  0:32                 ` Aaron Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZIOE02wGf0ZAghfq@idiocy.org \
    --to=alan@idiocy.org \
    --cc=63187@debbugs.gnu.org \
    --cc=aaronjensen@gmail.com \
    --cc=eliz@gnu.org \
    --cc=justksqsf@gmail.com \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).