From: "Jan Djärv" <jan.h.d@swipnet.se>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: Adrian Robert <Adrian.B.Robert@gmail.com>, emacs-devel@gnu.org
Subject: Re: Patch to fix the Bar Cursor Too Narrow problem on Mac OS X
Date: Thu, 24 Feb 2011 13:38:11 +0100 [thread overview]
Message-ID: <4D665133.20805@swipnet.se> (raw)
In-Reply-To: <8762saiki1.fsf@stupidchicken.com>
2011-02-23 21:06, Chong Yidong skrev:
> Adrian Robert<Adrian.B.Robert@gmail.com> writes:
>
>> OK, I'll bite on this since it's my code originally. :-) I
>> deliberately chose not to break into subfunctions like X since the
>> clarity of having the whole implementation in one block seemed greater
>> than that gained by splitting out. Also a number of redundancies in
>> x_draw_bar_cursor() and x_draw_hollow_cursor() are saved.
>
> Nothing wrong with choosing not to break into subfunctions, but there
> some differences in the basic logic that make it hard to maintain.
>
> Consider the xterm behavior. For FILLED_BOX_CURSOR, we call
> draw_phys_cursor_glyph to redraw that glyph with the cursor face
> (DRAW_CURSOR). No additional repainting is necessary. For bar cursors,
> we paint an extra thin bar on top of the screen area for the existing
> glyph; there is no need to call draw_phys_cursor_glyph.
> In contrast, ns_draw_window_cursor repaints via NSRectFill (for both box
> and bar cursors), and then calls draw_phys_cursor_glyph (for both box
> and bar cursors).
You are simplifying things. For X a different GC with different background
and foreground from normal text is used when drawing the glyph (the cursor
face). What X in fact does is filling with the background and then paint the
glyph with the foreground.
There is no such thing in NS. You have to set the background of the cursor
face with NSRectFill, and then paint the foreground of the cursor face by
painting the glyph. It is basically the same thing, but NS does not have one
call for it.
> The NS terminal seems not to use DRAW_CURSOR for
> drawing filled box cursors. So the basic handling for box cursors seems
> to be completely different, and I don't understand the rationale.
I don't know what you mean, NS do use DRAW_CURSOR, just search for it in nsterm.m
Jan D.
next prev parent reply other threads:[~2011-02-24 12:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-18 4:29 Patch to fix the Bar Cursor Too Narrow problem on Mac OS X Ben Key
2011-02-19 19:15 ` Chong Yidong
2011-02-20 1:23 ` Ben Key
2011-02-21 17:40 ` Chong Yidong
2011-02-21 17:58 ` Chong Yidong
2011-02-21 21:15 ` Ben Key
2011-02-21 22:56 ` Ben Key
2011-02-22 0:23 ` Chong Yidong
2011-02-22 0:35 ` Chong Yidong
2011-02-22 13:09 ` Adrian Robert
2011-02-23 20:06 ` Chong Yidong
2011-02-24 12:38 ` Jan Djärv [this message]
2011-02-23 20:45 ` Chong Yidong
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=4D665133.20805@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=Adrian.B.Robert@gmail.com \
--cc=cyd@stupidchicken.com \
--cc=emacs-devel@gnu.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.