From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#63187: 30.0.50; Tail of longer lines painted after end of nearby lines on macOS Date: Thu, 20 Jul 2023 22:02:53 -0400 Message-ID: References: <335C856F-41F7-48B8-AF42-B2406065C7A9@gmail.com> <047EC69F-EAC7-458F-A288-13DDC77DE187@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29272"; mail-complaints-to="usenet@ciao.gmane.io" To: Alan Third , Kai Ma , Aaron Jensen , 63187@debbugs.gnu.org, Eli Zaretskii , Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 21 04:04:17 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 1qMfVB-0007NG-J4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Jul 2023 04:04:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMfUy-0006AG-K6; Thu, 20 Jul 2023 22:04:04 -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 1qMfUw-0006A7-IE for bug-gnu-emacs@gnu.org; Thu, 20 Jul 2023 22:04:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qMfUw-0000uh-9r for bug-gnu-emacs@gnu.org; Thu, 20 Jul 2023 22:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qMfUv-0003zm-SQ for bug-gnu-emacs@gnu.org; Thu, 20 Jul 2023 22:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Jul 2023 02:04:01 +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.168990499515298 (code B ref 63187); Fri, 21 Jul 2023 02:04:01 +0000 Original-Received: (at 63187) by debbugs.gnu.org; 21 Jul 2023 02:03:15 +0000 Original-Received: from localhost ([127.0.0.1]:60249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMfUB-0003yg-0k for submit@debbugs.gnu.org; Thu, 20 Jul 2023 22:03:15 -0400 Original-Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:44057) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qMfU6-0003yJ-OM for 63187@debbugs.gnu.org; Thu, 20 Jul 2023 22:03:14 -0400 Original-Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2b974031aeaso1661851fa.0 for <63187@debbugs.gnu.org>; Thu, 20 Jul 2023 19:03:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689904985; x=1690509785; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+QAGIXGX4RSHpIy/KEw2m836c/G47foE5+2Q/gyTtGo=; b=AkuMddafu4rirZExuzFhyGzM3PArQJhdJYWUFyHw+4NtDRGISycKGqqFVLDIkRx9nJ jaMjGVdBK51Bn5YGJTBzQeiV9IV9a7jflyEBlGKiENg4gy9UT/9ndWBmnwobhMrppoR4 BeCdYmxwCy8/85iLc35YG4CS3Nif2uZLtG6PPpwzx06CjIY7M3QX+r9DSdk2rr1ZM0lZ DIcITGdCnhukrM1YfX6nAShn7kaTXVI8n+9kg4my9QOA1zsD7s527JF0qzRbjAm8+Zox SWKQwrROI6gzf9kkcNeFJHmOy74l4cEMoQZVk8pKckdiqw1l+BAwgnI8PAN1I3bcyq27 nExA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689904985; x=1690509785; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+QAGIXGX4RSHpIy/KEw2m836c/G47foE5+2Q/gyTtGo=; b=AnA3KYDniktXgwN4S8Y2UMVvIRksGfykautgsPioTtQAEcJ6hSfmBSxOTDifO0RsG7 gKVeTzJEBwrrQwfPcFpcSfFq/c46RsRqxyTE6DofIlfviR+xzzffcTMq5LY6/4XaKG+t dWwEpzYXv8rG8X2TJrImEQ2wWWjQDFO81AeTe9h2heCiaNyt3xPv0bkl+rFdFnTclpuk v/sdsFAT2muQKIIUhunZu+nuaVqglj+OG/8bvzKgLK7JhI3HgcyS/X8zQ19X9M4WJH2y CI87V9mW03g11LrXFu8FH81q/OLXLLDHDC1njZzza8Liwrc4jAeZgak3wWi3kMwQtNjx X/xw== X-Gm-Message-State: ABy/qLaatps1TrXVBy0a7DULep9XdqXToMceBfxf/qoTqTCNJEXD5V5c rs2lnKUJMfrtqr0afqgnbcYjUgNLdc5b5IyT8nE= X-Google-Smtp-Source: APBJJlGGJigZCPsy6PQOZIJvh+RZNtlKqAv26zP/HFuHgUVXAu564Vc40GyQy3jYBcQaC0E3K+OBHl/mgeMooOY5YsI= X-Received: by 2002:a05:6512:b0f:b0:4fb:7c40:9f95 with SMTP id w15-20020a0565120b0f00b004fb7c409f95mr291183lfu.47.1689904984564; Thu, 20 Jul 2023 19:03:04 -0700 (PDT) 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:265643 Archived-At: On Wed, Jun 28, 2023 at 3:53=E2=80=AFPM Alan Third wrote: > > On Mon, Jun 26, 2023 at 03:27:41PM +0800, Kai Ma wrote: > > > > > > > On Jun 25, 2023, at 20:46, Alan Third wrote: > > > > > >>> > > >>> modified src/nsterm.m @@ -10622,7 +10622,7 @@ - (void) display > > >>> { > > >>> NSTRACE_WHEN (NSTRACE_GROUP_FOCUS, "[EmacsLayer display]"); > > >>> > > >>> - if (context) > > >>> + if (context && context !=3D [NSGraphicsContext currentContext]) > > >>> { > > >>> [self releaseContext]; > > >>> > > >>> > > >>> ... > > >>> > > >>> Actually... > > >>> > > >>> That change should probably be made anyway. If the NS run loop kick= s > > >>> in between an ns_focus call and an ns_unfocus call, it could call > > >>> display and our display function will happily destroy the existing > > >>> context without creating a new one, so any *subsequent* drawing > > >>> operations, up until ns_unfocus, will be lost. > > >> > > >> OK, I'm adding this to my current build. > > >> > > >> Is this in line with the type of issue I'm seeing where scrolling > > >> works but the ghosting either replicates (or scrolls with it?) In > > >> other words, what would you expect to see in this scenario? Would it > > >> just stop painting entirely? > > > > > > > > > Kai, it might be worth trying just that change above, while keeping > > > the call to performSelectorInMainThread and see if it fixes anything > > > for you. > > > > Unfortunately, the problem persists (as in the YouTube video) if perfor= mSelectorInMainThread is present. > > OK. Thanks for trying it. I've been using this for about a month now and have seen no artifacts: diff --git a/src/nsterm.m b/src/nsterm.m index 78089906752..d23fb650ab8 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -2708,9 +2708,6 @@ Hide the window (X11 semantics) EmacsView *view =3D FRAME_NS_VIEW (f); [view copyRect:srcRect to:dest]; -#ifdef NS_IMPL_COCOA - [view setNeedsDisplayInRect:destRect]; -#endif } unblock_input (); @@ -10435,7 +10432,7 @@ @implementation EmacsLayer cache. If no free surfaces are found in the cache then a new one is created. */ -#define CACHE_MAX_SIZE 2 +#define CACHE_MAX_SIZE 1 - (id) initWithColorSpace: (CGColorSpaceRef)cs { @@ -10621,7 +10618,7 @@ - (void) display { NSTRACE_WHEN (NSTRACE_GROUP_FOCUS, "[EmacsLayer display]"); - if (context) + if (context && context !=3D [NSGraphicsContext currentContext]) { [self releaseContext]; I'm not sure what the ramifications are for CACHE_MAX_SIZE 1 on slower machines, but I don't notice any performance issues on my M1. Alan, what do you think we should do? Is there anything else you think I should test for the next bit of time? Thanks, Aaron