From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#36633: Scrolling by pixels: visible stretch glyphs overwrite header-line. Date: Tue, 16 Jul 2019 21:38:56 +0100 Message-ID: <20190716203856.GA65011@breton.holly.idiocy.org> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2oS5YaxWCcQjTEyO" Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="62162"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.12.0 (2019-05-25) Cc: 36633@debbugs.gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 16 22:40:09 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hnUF6-000Fyu-5t for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Jul 2019 22:40:08 +0200 Original-Received: from localhost ([::1]:52198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnUF5-00024I-6j for geb-bug-gnu-emacs@m.gmane.org; Tue, 16 Jul 2019 16:40:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41915) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hnUF2-000247-1Q for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2019 16:40:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hnUF0-0007SV-Rm for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2019 16:40:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42413) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hnUF0-0007SH-KS for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2019 16:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hnUF0-00071F-Ft for bug-gnu-emacs@gnu.org; Tue, 16 Jul 2019 16:40: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: Tue, 16 Jul 2019 20:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36633 X-GNU-PR-Package: emacs Original-Received: via spool by 36633-submit@debbugs.gnu.org id=B36633.156330954826887 (code B ref 36633); Tue, 16 Jul 2019 20:40:02 +0000 Original-Received: (at 36633) by debbugs.gnu.org; 16 Jul 2019 20:39:08 +0000 Original-Received: from localhost ([127.0.0.1]:51234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnUE7-0006zb-Hk for submit@debbugs.gnu.org; Tue, 16 Jul 2019 16:39:07 -0400 Original-Received: from mail-wr1-f45.google.com ([209.85.221.45]:33219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hnUE6-0006z6-2g for 36633@debbugs.gnu.org; Tue, 16 Jul 2019 16:39:06 -0400 Original-Received: by mail-wr1-f45.google.com with SMTP id n9so22424932wru.0 for <36633@debbugs.gnu.org>; Tue, 16 Jul 2019 13:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=url4CkPWVV5RzbHENV8AzhPc355bcCVxkqYQmMWdLWM=; b=kSCKyCXXw9jaaMaGaQE8b6SYYDAClt1aQ8fQRK2HN3GxRytUSFsnTJGL4XSpCxPZCE DpQ6djMaqyBOFqCswtMKVcaQ1hCCpaJaxvnJnF4rcqFoMuJU3ms2VEoaFs9jnTHCLvOs i8cr+PYvwG17xKzmZefdH2+kmPyFrttlKK9k0hrWANccBoJ0GamTPiVR+WOuEDR2G5Cm gQOC6O/tIrCDfcxitZhtpNHXQjoLPcWNdAJUwzLSLLLgayOeUQtZh1d41YjMXN3f6zIh aBTWQrCwDhfwMJ+InQTwe8z7CQdZbmPK5a1B5NMGG3LU+2vxS32R1LlW24gNPhHz7/Dv zCZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=url4CkPWVV5RzbHENV8AzhPc355bcCVxkqYQmMWdLWM=; b=T1/7aSC6LhIYFjMK8c3L6Bjx9ofvf0pQN0gsEpWzYEf63PYzuTJNBY/OsXudCmF4mx V0NFVTypywU9Y/aex32DbTXO9lZUQXWg099YNf45s4Kk1faH+g91N+hw41paO0qo5Khb aTm2mgrGUdfGaZzjhUeu5QngO0ExSo2YlmyCPNxg+m+cxNGbOkXLjpy7F39YvaZYbPYS zH/S04rruY4Kw+/VKVnDzqXEd7zuTul4DEuiQNTNGTsyNg62FmJkwX+1HqPph62/yV97 q+ZmUjxSaCCw0bY77VCYERmDvSoHP9qO5FK06TI4/II/sb0rv2ill7i+D/yFYEjemlgN cxuQ== X-Gm-Message-State: APjAAAW3vwYyFHTQYsUe8wJyqezjpBDF1OtrmSW2eUyUAmGPDD0vebQS pzN1dPQYFmyZewRF7nma0yZESbVf X-Google-Smtp-Source: APXvYqxS5vLGKrNlZkYsPxf+yqsVOQyGeS0Tyb2tUgv71fKClepJsztFuf4HjCDTEtlSN4tuQ7HEjg== X-Received: by 2002:adf:aac8:: with SMTP id i8mr27685771wrc.56.1563309539734; Tue, 16 Jul 2019 13:38:59 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-b0d8-8cf9-dc55-40ba.holly.idiocy.org. [2001:8b0:3f8:8129:b0d8:8cf9:dc55:40ba]) by smtp.gmail.com with ESMTPSA id p14sm18955126wrx.17.2019.07.16.13.38.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 13:38:58 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163209 Archived-At: --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Sun, Jul 14, 2019 at 09:47:25AM -0700, Keith David Bershatsky wrote: > Here are links to two (2) youtube videos showing the issue on Emacs > 26.1 (built by https://emacsformacosx.com/ a few months ago) and > also the master branch that I built using a commit from 07/10/2019 > (40cd6278ba965f3a9fcdddc568eb9ee7c69cf899). I don't have a 26.2 > build at the moment. The issue is less noticeable on the master > branch, but can still be seen nevertheless. I have not studied the > code as to what makes this feature work, but offhand would think > that the header-line should not be overwritten by the row moving > upwards (rather than updated after it has been overwritten). > > Emacs 26.1: https://youtu.be/Y8cZfURSwZc > > Emacs Master Branch: https://youtu.be/BO3r9_6OvYo OK, that’s really not what I was expecting to see. It looks to me like the stretch glyph code in nsterm.m is just nonsensical... I don’t really know what to make of it. I guess I’m missing something? Anyway, patch attached. I don’t see anything particularly wrong with it applied, but it’s possible I’ve reintroduced some bug where the modeline gets partially overwritten. The patch is against master, but it’s probably possible to apply it to 26 manually. -- Alan Third --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Fix-stretch-glyphs-overlap-with-line-above-bug-36633.patch" >From 637813be1f6cd6119bddd7864e1f7778e46f2b71 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Tue, 16 Jul 2019 21:32:23 +0100 Subject: [PATCH] Fix stretch glyphs overlap with line above (bug#36633) * src/nsterm.m (ns_dumpglyphs_stretch): Move overwriting of the clipping rectangle to after performing clipping. --- src/nsterm.m | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/nsterm.m b/src/nsterm.m index 02331826d9..b8754278f0 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3913,10 +3913,13 @@ Function modeled after x_draw_glyph_string_box (). if (!s->background_filled_p) { n = ns_get_glyph_string_clip_rect (s, r); - *r = NSMakeRect (s->x, s->y, s->background_width, s->height); if (ns_clip_to_rect (s->f, r, n)) { + /* FIXME: Why are we reusing the clipping rectangles? The + other terms don't appear to do anything like this. */ + *r = NSMakeRect (s->x, s->y, s->background_width, s->height); + if (s->hl == DRAW_MOUSE_FACE) { face = FACE_FROM_ID_OR_NULL (s->f, @@ -3951,13 +3954,6 @@ Function modeled after x_draw_glyph_string_box (). r[i].origin.x += leftoverrun; r[i].size.width -= leftoverrun; } - - /* XXX: Try to work between problem where a stretch glyph on - a partially-visible bottom row will clear part of the - modeline, and another where list-buffers headers and similar - rows erroneously have visible_height set to 0. Not sure - where this is coming from as other terms seem not to show. */ - r[i].size.height = min (s->height, s->row->visible_height); } [bgCol set]; -- 2.21.0 --2oS5YaxWCcQjTEyO--