unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <athird@googlemail.com>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: Re: nsterm.m: How to play nice with Mojave revisions -- #17684 (crosshairs) and #22873 (multiple fake cursors) ...
Date: Fri, 12 Oct 2018 09:54:15 +0100	[thread overview]
Message-ID: <CABGBtwmVHY_r-_aV8=FhEkkt7cnk+p7aYG+vdS82QnE6R8cyAw@mail.gmail.com> (raw)
In-Reply-To: <m2pnwgnd6i.wl%esq@lawlist.com>

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

On Fri, 12 Oct 2018, 02:54 Keith David Bershatsky, <esq@lawlist.com> wrote:

> Given the latest revisions to nsterm.m that provide compatibility with
> Mojave, I have been unable to get the drafts of feature requests #17684
> (crosshairs) and #22873 (multiple fake cursors) to work properly.
>
> The draft feature request work by calling from xdisp.c:
>
>   FRAME_RIF (f)->draw_window_cursor (w, glyph_row, x, y, cursor_type,
>                                      cursor_width, true, active_cursor_p);
>
> And, I modify a few settings such as color, coordinates, (x, y, fx, fy and
> h), cursor_type ...
>
> As far as I can see, ns_clip_to_row (within ns_draw_window_cursor) does
> not return ON/TRUE with the drafts of feature requests #17684 / #22873.
>
> If I play around by bypassing ns_clip_to_row and force ON/TRUE within
> ns_draw_window_cursor, the lines containing the fake cursors are inverted
> -- like Emacs is upside down.
>
> Any ideas how I can properly convince ns_clip_to_row to return ON/TRUE and
> also have the fake cursors appear right-side-up at the non-inverted frame-Y
> coordinate?
>

Hi Keith, this looks a bit strange.

The idea is that when running redisplay cocoa does not let you draw to the
screen, so ns_clip_to_rect, etc., marks the area as needing to be redrawn
later, and returns NO so you know not to try drawing to the frame.

Later drawRect is called with a list of the areas that have been marked as
needing redrawn and it calls expose on those areas and so Emacs runs the
drawing functions again, but this time ns_clip_to_rect returns YES so you
know you can go ahead and draw.

For some reason NSTRACE doesn't show the functions being called from within
drawRect, so if you're relying on that it may mislead you.

I don't know what's going on with your code, is there somewhere I can have
a look?

>

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

  reply	other threads:[~2018-10-12  8:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12  1:53 nsterm.m: How to play nice with Mojave revisions -- #17684 (crosshairs) and #22873 (multiple fake cursors) Keith David Bershatsky
2018-10-12  8:54 ` Alan Third [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-10-13  2:17 Keith David Bershatsky
2018-10-14 18:03 ` Alan Third
2018-10-15  0:05 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

  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='CABGBtwmVHY_r-_aV8=FhEkkt7cnk+p7aYG+vdS82QnE6R8cyAw@mail.gmail.com' \
    --to=athird@googlemail.com \
    --cc=emacs-devel@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).