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: Mon, 8 May 2023 23:07:00 -0400 Message-ID: References: <87ilddec31.fsf@yahoo.com> <87edo0exct.fsf@yahoo.com> <83wn1sns1n.fsf@gnu.org> <87pm7kchqw.fsf@yahoo.com> <83pm7knpzi.fsf@gnu.org> 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="39854"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , Alan Third , 63187@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 09 05:08: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 1pwDi5-000AA9-5p for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 May 2023 05:08:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwDhr-0005Yy-8o; Mon, 08 May 2023 23:08:03 -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 1pwDhq-0005Yi-8b for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 23:08:02 -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 1pwDhq-0003JF-06 for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 23:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pwDhp-0001jf-RK for bug-gnu-emacs@gnu.org; Mon, 08 May 2023 23:08: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: Tue, 09 May 2023 03:08: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.16836016396611 (code B ref 63187); Tue, 09 May 2023 03:08:01 +0000 Original-Received: (at 63187) by debbugs.gnu.org; 9 May 2023 03:07:19 +0000 Original-Received: from localhost ([127.0.0.1]:42100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwDh9-0001iZ-2G for submit@debbugs.gnu.org; Mon, 08 May 2023 23:07:19 -0400 Original-Received: from mail-pj1-f53.google.com ([209.85.216.53]:47614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwDh7-0001iL-8e for 63187@debbugs.gnu.org; Mon, 08 May 2023 23:07:17 -0400 Original-Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-24dfc3c662eso3675886a91.3 for <63187@debbugs.gnu.org>; Mon, 08 May 2023 20:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683601631; x=1686193631; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ofeIdF+xf45DX8h86LUKZfk3e1ic8oGu6sCE4mkCMPU=; b=Ep31aW7YFKtMPEYFmem8+yAL/UtIO2ERQDcFVjcI4R/HtTa1zOQts9okOOtxpjMusz UblgditUU+afyLjrnMMdA6E2u9OxlwX8xgdvjtAan5nmPOoQCKYw/6PGnoyap2D82BlD w7M8KmjgG+UiYVenMarS1cEOJ4f5zsrZwHq5Zz3dLy1f4UsxL5SlA+zK0Z23G2XhB5+W nGRLXFWKF3BPhJAP8rz9ubB9KIJa7CVQ+D92BRqlyPBg7cGeqaE3vZaqebTSigGLynDi xrrnpSAARzAdBIJ7zNfUzqqJUVoCzxg0xTgbx3kH3l4iILpkOCEuhGVX4X5eXCAHy2qM eQsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683601631; x=1686193631; h=content-transfer-encoding:cc: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=ofeIdF+xf45DX8h86LUKZfk3e1ic8oGu6sCE4mkCMPU=; b=Mt6ym9cLPELgGDkjDCtN4SpqrNs9LYNRkEx/23vkIGk8WNMlQ1mr/RGJNYYsOsmy/u jBBYMckHnX17nci8zhqQOod404wmJsBs3PosLVHv+WE788rLkDAAmex+npfyE7YZemTS bZdSXzPm/trNgb2bq2BHdHrHRr8qo4y8RMTvb2eMhfAE9xQmzXEKcP+ko4GthZbwsIDA Vg/lKDlKEM+YGxdSLHRftuiz+bMc/B0X322a1LGbXw1ZqUNLbNX2ePAkVqVNSvNOt8vr jclKwNlZ4KHe4JSFL4/NHVobXfBhW/hEd4K/Sn2SLay2NbGJjduKC/wNKBqoBo9DFp8z BrWA== X-Gm-Message-State: AC+VfDxtWovafUSufQBO8gCVy6PqhCWgeCAJnhZoAdqg/EMBoBI3LpYB 5CplhbE+/BeEVdfVaVnDprFEAwM2eZnjP9rtLVI= X-Google-Smtp-Source: ACHHUZ7KJL3ZrHmsFev0jr/WebCZZ7CF4JV3CSR3Z4G5McjCxgT6oHotYf2ReyZSgAzjwKeCXQbIrcOHj9aY6gblQsk= X-Received: by 2002:a17:90a:9305:b0:250:40f5:6838 with SMTP id p5-20020a17090a930500b0025040f56838mr10986419pjo.30.1683601631430; Mon, 08 May 2023 20:07:11 -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:261378 Archived-At: On Mon, May 1, 2023 at 9:47=E2=80=AFAM Aaron Jensen = wrote: > > On Mon, May 1, 2023 at 9:24=E2=80=AFAM Eli Zaretskii wrote= : > > > > > From: Po Lu > > > Cc: aaronjensen@gmail.com, 63187@debbugs.gnu.org > > > Date: Mon, 01 May 2023 21:18:31 +0800 > > > > > > Eli Zaretskii writes: > > > > > > >> Cc: 63187@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" > > > >> > > > >> Aaron Jensen writes: > > > >> > > > >> > Is there anything specific to macOS that is involved in scrollin= g optimization? > > > >> > > > >> Yes, Apple deleted the API used to perform bit blits, so Emacs use= s 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 =3D NSMakeRect (x, from_y, width, height); > NSPoint dest =3D NSMakePoint (x, to_y); > EmacsView *view =3D 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 =3D NSMakeRect (x, from_y, width, height); NSPoint dest =3D NSMakePoint (x, to_y); + NSRect destRect =3D NSMakeRect (x, from_y, width, height); EmacsView *view =3D FRAME_NS_VIEW (f); [view copyRect:srcRect to:dest]; #ifdef NS_IMPL_COCOA - [view setNeedsDisplayInRect:srcRect]; + [view setNeedsDisplayInRect:destRect]; #endif } Aaron