From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <50104E0C-A861-4762-8081-55F2CF2390AD@gmail.com> <76A3A6C3-CD32-4731-927C-349471F21801@gmail.com> <2A505E20-55E2-4788-A21C-B94068299E50@gmail.com> <29949E40-D5D5-4DE1-BD81-93D1BA3D4F51@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="fF3vKceoYcwG26GD" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40383"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , Kai Ma , Eli Zaretskii , 63187@debbugs.gnu.org To: Aaron Jensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 09 22:01:33 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7iIe-000AIX-2u for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Jun 2023 22:01:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q7iID-00087Z-QN; Fri, 09 Jun 2023 16:01:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7iIB-00087A-7t for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 16:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q7iIA-0004HA-UI for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 16:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q7iIA-0006lQ-7R for bug-gnu-emacs@gnu.org; Fri, 09 Jun 2023 16:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Jun 2023 20:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63187 X-GNU-PR-Package: emacs Original-Received: via spool by 63187-submit@debbugs.gnu.org id=B63187.168634082825940 (code B ref 63187); Fri, 09 Jun 2023 20:01:02 +0000 Original-Received: (at 63187) by debbugs.gnu.org; 9 Jun 2023 20:00:28 +0000 Original-Received: from localhost ([127.0.0.1]:60622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7iHb-0006kJ-TX for submit@debbugs.gnu.org; Fri, 09 Jun 2023 16:00:28 -0400 Original-Received: from dane.soverin.net ([185.233.34.25]:44961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7iHa-0006k3-CU for 63187@debbugs.gnu.org; Fri, 09 Jun 2023 16:00:27 -0400 Original-Received: from smtp.soverin.net (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4QdBl86Qxlz10fw; Fri, 9 Jun 2023 20:00:20 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4QdBl84KvtzHl; Fri, 9 Jun 2023 20:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1686340820; bh=E9LQqFmr22Tz8ItpAb/9gX1dtzL7JsQ87UFN7xGN2IQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OSBgbhrFjgQ34zbSFFaRrjl9DjOx57bfd6PPYzLDmInSg3C17s8r63EetsO4EEgrk u81QKwz3xOIKgkIRX8J15Hl5ZTVbIcNXa7pOyCco8undsul525N/XhntkF5hwaGZzg Ys+Cc/2jbHilrf0e9JVDadKUgj1Z5QXbr3+JVDA67vPqsyHK+tScMPgO12wEN2baQ2 3OXTpuaf6gdWrxxDWUPfGh7dvXv+Ndh1Yx78DJ7kHjY/Eii92hc4vns7lggqlk/msE DF5vAJVo5d3lhcEL/jVyPL3OvUpzaPM8qgg2sLBjMSiW9NQGQ4nx6ijFNgBAul6uw+ XCvblqmQrG6cg== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95) (envelope-from ) id 1q7iHT-000QLS-ES; Fri, 09 Jun 2023 21:00:19 +0100 X-Soverin-Authenticated: true Mail-Followup-To: Alan Third , Aaron Jensen , Kai Ma , 63187@debbugs.gnu.org, Eli Zaretskii , Po Lu Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263185 Archived-At: --fF3vKceoYcwG26GD Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Fri, Jun 09, 2023 at 02:46:29PM -0400, Aaron Jensen wrote: > On Fri, Jun 9, 2023 at 2:27 PM Alan Third 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 --fF3vKceoYcwG26GD Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Reduce-graphical-glitches-in-certain-circumstances-o.patch" >From b34cd84c1b070248b396d2ec82018be99b529d31 Mon Sep 17 00:00:00 2001 From: Alan Third 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 --fF3vKceoYcwG26GD--