unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: 36633@debbugs.gnu.org
Subject: bug#36633: Scrolling by pixels: visible stretch glyphs overwrite header-line.
Date: Tue, 16 Jul 2019 21:38:56 +0100	[thread overview]
Message-ID: <20190716203856.GA65011@breton.holly.idiocy.org> (raw)
In-Reply-To: <m2pnmcd0ma.wl%esq@lawlist.com>

[-- Attachment #1: Type: text/plain, Size: 1270 bytes --]

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

[-- Attachment #2: 0001-Fix-stretch-glyphs-overlap-with-line-above-bug-36633.patch --]
[-- Type: text/plain, Size: 1904 bytes --]

From 637813be1f6cd6119bddd7864e1f7778e46f2b71 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
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


  parent reply	other threads:[~2019-07-16 20:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-13  2:10 bug#36633: Scrolling by pixels: visible stretch glyphs overwrite header-line Keith David Bershatsky
2019-07-13  6:19 ` Eli Zaretskii
2019-07-13  8:32   ` Stefan Kangas
2019-07-13  8:39     ` Eli Zaretskii
2019-07-14 10:39 ` Alan Third
2019-07-14 16:47 ` Keith David Bershatsky
2019-07-15 12:26   ` Tak Kunihiro
2019-07-16 20:38   ` Alan Third [this message]
2019-07-14 16:52 ` Keith David Bershatsky
2019-07-17  6:34 ` Keith David Bershatsky
2019-07-17 18:31   ` Alan Third
2019-07-17 19:08     ` Keith David Bershatsky
2019-07-17 23:31     ` Tak Kunihiro
2019-07-18  3:56 ` Keith David Bershatsky
2019-07-27 17:32   ` Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190716203856.GA65011@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=36633@debbugs.gnu.org \
    --cc=esq@lawlist.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).