From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel 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 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000023f0230578043c42" X-Trace: blaine.gmane.org 1539334360 19355 195.159.176.226 (12 Oct 2018 08:52:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2018 08:52:40 +0000 (UTC) Cc: Emacs-Devel devel To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 12 10:52:36 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gAtBU-0004w8-7H for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 10:52:36 +0200 Original-Received: from localhost ([::1]:39055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAtDa-0005jQ-Cw for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 04:54:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAtDQ-0005j7-LO for emacs-devel@gnu.org; Fri, 12 Oct 2018 04:54:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAtDO-00042N-4r for emacs-devel@gnu.org; Fri, 12 Oct 2018 04:54:35 -0400 Original-Received: from mail-it1-x12f.google.com ([2607:f8b0:4864:20::12f]:38386) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAtDL-0003nq-FT for emacs-devel@gnu.org; Fri, 12 Oct 2018 04:54:32 -0400 Original-Received: by mail-it1-x12f.google.com with SMTP id i76-v6so17212785ita.3 for ; Fri, 12 Oct 2018 01:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tH9jSAqPjw8FpuCMKd4xczRJyDnPPZ6xJC7/LVHpaSI=; b=bv1b01tHdRr9m7OvRhpRBMrPnmYRQWtiGW+hax3JAQIgm0H8OzGD+Hx0x7uNq+G6+Z RjQvwSA2T1tbob+/OBzULTGdP5EsYF/yCp8RIpfx+4vvZM5i1+ljbd9vDmDypkTXFtpj E+xKfsYPQJEaiFg9uo+Tuo2yIh2vix9PoVpANbhIH1dZRhnB/sd+Pt4A2MAhAkbi8mtc +PJfcfwGH6FmzjttWwDw7+zq5sBzinuSflYWE8Cb4a96rKNo0t2X3fLnXaSU7/4RRZ3d iaDzf55tkq+PgdyKSpyfuoBOtj7DebbbNQkS8V03VmP0Q1vOzXzW1qgT2vY5Wj6wNmRu iupg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tH9jSAqPjw8FpuCMKd4xczRJyDnPPZ6xJC7/LVHpaSI=; b=EoKbqq1qCQDd5KRbylaUlxc24QKZ7bVS0plVO5Tlzbb13Hq0JDEgDWU9a/Zp2AVNbm bgivjRjaKCNDfHaFuT3GlgDaaX/aeCEvKXMkWW9dGIKqHlFvcP2O2CpVo6g73ZEzuqtS +/rMZdP5pWWssTqi04ce/sCrTK0eP5ao6W87oL9mkI88TASLYEJns9z9MrjNS3QRfk2z Irus61BWQ/JCEcmybjxEluoF5N5bUlun4hjpXK2OIFsX3satcfXa5Q+pE+s4OeiEGEuw iHD3eR6REGydBpXjCaTfnoOCkyqdBeupDsBAdpD5A97NWRHRgvzy210Bwo/esdzzcTb5 QCiw== X-Gm-Message-State: ABuFfoiUpqU+YsZ8VlEU/mu6GL+rljnqqoLacFD80wMmbsxGtl/iy3q+ GbKE/0FdSq8XgKf5Vypu95bZmgKTawW85beA8+33ww== X-Google-Smtp-Source: ACcGV62mTxY0E6YeuOP5ORcvRG7rpWpoew8xW4WeDk5QYie3JaWAgsMVzr/qPNYoWZA5sePcBuD3EoDS9ozJL8A1HvM= X-Received: by 2002:a24:9790:: with SMTP id k138-v6mr4018218ite.69.1539334467742; Fri, 12 Oct 2018 01:54:27 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::12f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230345 Archived-At: --00000000000023f0230578043c42 Content-Type: text/plain; charset="UTF-8" On Fri, 12 Oct 2018, 02:54 Keith David Bershatsky, 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? > --00000000000023f0230578043c42 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


= On Fri, 12 Oct 2018, 02:54 Keith David Bershatsky, <esq@lawlist.com> wrote:
Given the latest revisions to nsterm.m that provide compatibilit= y with Mojave, I have been unable to get the drafts of feature requests #17= 684 (crosshairs) and #22873 (multiple fake cursors) to work properly.

The draft feature request work by calling from xdisp.c:

=C2=A0 FRAME_RIF (f)->draw_window_cursor (w, glyph_row, x, y, cursor_typ= e,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0cursor_width, tr= ue, 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_dr= aw_window_cursor, the lines containing the fake cursors are inverted -- lik= e 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.=C2=A0

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

Lat= er drawRect is called with a list of the areas that have been marked as nee= ding redrawn and it calls expose on those areas and so Emacs runs the drawi= ng functions again, but this time ns_clip_to_rect returns YES so you know y= ou 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 g= oing on with your code, is there somewhere I can have a look?
--00000000000023f0230578043c42--