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: Mon, 1 May 2023 18:26:20 +0100 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=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3216"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , 63187@debbugs.gnu.org, aaronjensen@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 01 19:27:25 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 1ptXJ7-0000dx-2X for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 May 2023 19:27:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptXIq-0002Vh-8t; Mon, 01 May 2023 13:27:08 -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 1ptXIl-0002VP-9A for bug-gnu-emacs@gnu.org; Mon, 01 May 2023 13:27: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 1ptXIl-00035I-0X for bug-gnu-emacs@gnu.org; Mon, 01 May 2023 13:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ptXIk-00006y-Hl for bug-gnu-emacs@gnu.org; Mon, 01 May 2023 13:27: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: Mon, 01 May 2023 17:27: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.1682961998383 (code B ref 63187); Mon, 01 May 2023 17:27:02 +0000 Original-Received: (at 63187) by debbugs.gnu.org; 1 May 2023 17:26:38 +0000 Original-Received: from localhost ([127.0.0.1]:40962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptXII-000063-Nj for submit@debbugs.gnu.org; Mon, 01 May 2023 13:26:38 -0400 Original-Received: from dane.soverin.net ([185.233.34.21]:37385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ptXID-00005k-Ch for 63187@debbugs.gnu.org; Mon, 01 May 2023 13:26:33 -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 4Q999W10SCz9r; Mon, 1 May 2023 17:26:23 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4Q999V3MMmzJy; Mon, 1 May 2023 17:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1682961983; bh=ihWqUGnSSOa47CgpXYLgJbEH2UNLx9puX/Pd75JiUp8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=m80kCaBq6nY/qaGu2nE7wOD25rDeOg8E2W2mceW9Iwh3yDh+8TURwIRXJJPRrboL7 7+l++sxV0ANV/3gXcFThJZe0482fhLKcdysnthrKojWXBj+q+fqH+GWM3dkxkpjyhG 3Vo/QkobGttcP7WeHHRBwxYQPt91p4ToxeEYTCwe8OeR6p7AV08jKa/rrw5cuxLD2+ SGqVZk1Zyh1rA/dKBA8eh6FsT9JIm5HPhaVyQF7dHNsiqxYVKBJkCUUN99mvMLiQ6E XsoB21Gk5fxNUNlMSFEPnIJppbbLkdAf6tOcr/tScXhVoREPbji7q7UZO77tcP9KDn m+Fgwg1Gm7U2A== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95) (envelope-from ) id 1ptXI4-000Cai-TL; Mon, 01 May 2023 18:26:20 +0100 X-Soverin-Authenticated: true Mail-Followup-To: Alan Third , Eli Zaretskii , Po Lu , 63187@debbugs.gnu.org, aaronjensen@gmail.com Content-Disposition: inline In-Reply-To: <83pm7knpzi.fsf@gnu.org> 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:260882 Archived-At: On Mon, May 01, 2023 at 04:25:05PM +0300, 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 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. This is one of the many reasons I walked away from the NS port. ;) I'm 99% certain that [EmacsView copyRect:] is correct. I went over it numerous times. It's just doing a simple copy of one rectangle of a graphics buffer to another, identically sized, rectangle. It handles overlapping rectangles and there's really not very much logic in it to go wrong. Po Lu asks about how it synchronises with the system, and it doesn't really have to. The system draws into the same buffer that copyRect accesses. It does make me wonder if there's a rare occasion when copyRect is called and the system hasn't flushed all it's drawing instructions to the buffer yet. It's probably possible to force it to flush by doing something like: [[NSGraphicsContext currentContext] flushGraphics]; at the top of copyRect. Preferably only on macOS 10.14 and above, but it probably makes no difference on other platforms since scrollRect should force a flush anyway. My memory of Aaron's previous bug report about this was that it looked like, in some cases at least, the rectangle being copied was too wide and copyRect, not being very smart, was just wrapping off the edge of the buffer onto the next row of pixels, but I couldn't find any reason for that to happen since afaik all the callers check the Emacs window size so should never ask to copy a too-wide rectangle. -- Alan Third