[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch to fix the Bar Cursor Too Narrow problem on Mac OS X

From: Jan Djärv
Subject: Re: Patch to fix the Bar Cursor Too Narrow problem on Mac OS X
Date: Thu, 24 Feb 2011 13:38:11 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101208 Thunderbird/3.1.7

2011-02-23 21:06, Chong Yidong skrev:
Adrian Robert<address@hidden>  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 

        Jan D.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]