all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anders Lindgren <andlind@gmail.com>
To: Alan Third <alan@idiocy.org>
Cc: 16856@debbugs.gnu.org
Subject: bug#16856: [PATCH] Prevent cursor from over-drawing the fringe
Date: Fri, 20 May 2016 21:33:52 +0200	[thread overview]
Message-ID: <CABr8ebbAC2E3OtP-MJ70Eg4i1BdBX=h_LXXFaFqypa5cMoj66w@mail.gmail.com> (raw)
In-Reply-To: <20160517211415.GA85076@breton.holly.idiocy.org>

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

Hi!

I gave this patch a try.

It works well, the ns port now behaves like the win32 and gtk+ parts of
Emacs.

Do you want me to push it to master?

    -- Anders

Ps. When the text area doesn't partially overlap a column, the cursor can
be drawn in the fringe. It's a bit unfortunate that when it do overlap,
only the part of the cursor in the text area is drawn. A worst case
scenario is that only a single pixel of the cursor is visible. An ideal
solution would be to draw the cursor partially in the text area and
partially in the fringe, but without leaving garbage behind when moved.
However, this is nothing that we can solve here and now as it would require
change to all emacs ports and possibly the core system.


On Tue, May 17, 2016 at 11:14 PM, Alan Third <alan@idiocy.org> wrote:

> src/nsterm.m (ns_draw_window_cursor): Reduce clip area from ANY_AREA to
> TEXT_AREA. (bug#16856)
> ---
>  src/nsterm.m | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/src/nsterm.m b/src/nsterm.m
> index 1d48c04..5eb4c8f 100644
> --- a/src/nsterm.m
> +++ b/src/nsterm.m
> @@ -2873,9 +2873,8 @@ Note that CURSOR_WIDTH is meaningful only for (h)bar
> cursors.
>    r.size.height = h;
>    r.size.width = w->phys_cursor_width;
>
> -  /* TODO: only needed in rare cases with last-resort font in HELLO..
> -     should we do this more efficiently? */
> -  ns_clip_to_row (w, glyph_row, ANY_AREA, NO); /* do ns_focus(f, &r, 1);
> if remove */
> +  /* Prevent the cursor from being drawn outside the text area. */
> +  ns_clip_to_row (w, glyph_row, TEXT_AREA, NO); /* do ns_focus(f, &r, 1);
> if remove */
>
>
>    face = FACE_FROM_ID (f, phys_cursor_glyph->face_id);
> --
>
> I believe this fixes it.
>
> --
> Alan Third
>

[-- Attachment #2: Type: text/html, Size: 2367 bytes --]

  reply	other threads:[~2016-05-20 19:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-23 21:39 bug#16856: 24.3.50; Cursor leaves garbage in fringe (and a request: width of fringes + scroll bar should be full characters) Anders Lindgren
2014-02-24  3:44 ` Eli Zaretskii
2014-02-24  7:41 ` martin rudalics
2014-02-24 10:12   ` Anders Lindgren
2014-02-24 10:53     ` martin rudalics
2014-02-24 15:12       ` Anders Lindgren
2014-02-26 10:15         ` martin rudalics
2014-02-26 12:51           ` Anders Lindgren
2016-05-17 18:30       ` Alan Third
2016-05-17 19:06         ` Anders Lindgren
2016-05-17 21:14           ` bug#16856: [PATCH] Prevent cursor from over-drawing the fringe Alan Third
2016-05-20 19:33             ` Anders Lindgren [this message]
2016-05-21  7:35               ` Alan Third
2016-05-21 19:07                 ` Anders Lindgren
2016-07-17  6:57 ` bug#16856: 24.3.50; Cursor leaves garbage in fringe David Reitter
2017-11-09 18:50 ` bug#16856: Enable fringe cursor when *almost* exact_window_width_line_p Keith David Bershatsky
2017-11-09 18:58   ` bug#29233: " Keith David Bershatsky
2017-11-09 22:11   ` Alan Third
2017-11-10  7:53     ` bug#16856: " Eli Zaretskii
2017-11-11 16:34       ` Anders Lindgren
2017-11-11 17:25         ` Eli Zaretskii
2017-11-11 17:49           ` Anders Lindgren
2017-11-11 18:46             ` Alan Third
2017-11-11 20:36               ` Anders Lindgren
2017-11-10  0:31   ` bug#29233: " Keith David Bershatsky
2017-11-11 22:33   ` Keith David Bershatsky
2017-11-12  4:10     ` Eli Zaretskii
2017-12-12 23:24       ` Noam Postavsky
2017-11-09 19:00 ` bug#16856: Cursor leaves garbage in fringe Keith David Bershatsky

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

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

  git send-email \
    --in-reply-to='CABr8ebbAC2E3OtP-MJ70Eg4i1BdBX=h_LXXFaFqypa5cMoj66w@mail.gmail.com' \
    --to=andlind@gmail.com \
    --cc=16856@debbugs.gnu.org \
    --cc=alan@idiocy.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.