From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Newsgroups: gmane.emacs.devel Subject: Re: Patch to fix the Bar Cursor Too Narrow problem on Mac OS X Date: Thu, 24 Feb 2011 13:38:11 +0100 Message-ID: <4D665133.20805@swipnet.se> References: <87d3mnj0o1.fsf@stupidchicken.com> <87wrktxo9t.fsf@stupidchicken.com> <87ipwcor2z.fsf@stupidchicken.com> <87bp24oqhw.fsf@stupidchicken.com> <8762saiki1.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1298551108 12564 80.91.229.12 (24 Feb 2011 12:38:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 Feb 2011 12:38:28 +0000 (UTC) Cc: Adrian Robert , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 24 13:38:24 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PsaSc-0003qV-W1 for ged-emacs-devel@m.gmane.org; Thu, 24 Feb 2011 13:38:23 +0100 Original-Received: from localhost ([127.0.0.1]:45652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsaSc-0003FG-Jl for ged-emacs-devel@m.gmane.org; Thu, 24 Feb 2011 07:38:22 -0500 Original-Received: from [140.186.70.92] (port=59198 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsaSX-0003Et-Lm for emacs-devel@gnu.org; Thu, 24 Feb 2011 07:38:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsaSW-0001X7-QC for emacs-devel@gnu.org; Thu, 24 Feb 2011 07:38:17 -0500 Original-Received: from smtprelay-b11.telenor.se ([62.127.194.20]:42730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsaSW-0001Wt-7l for emacs-devel@gnu.org; Thu, 24 Feb 2011 07:38:16 -0500 Original-Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-b11.telenor.se (Postfix) with ESMTP id 32D4C1426E for ; Thu, 24 Feb 2011 13:38:12 +0100 (CET) X-SENDER-IP: [85.225.45.100] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag89ADPgZU1V4S1kPGdsb2JhbACIa507DAEBAQE1L74MhWAEj1mDEg X-IronPort-AV: E=Sophos;i="4.62,218,1297033200"; d="scan'208";a="175398755" Original-Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb2.telenor.se with ESMTP; 24 Feb 2011 13:38:11 +0100 Original-Received: from [172.20.199.2] (gaffa [172.20.199.2]) by coolsville.localdomain (Postfix) with ESMTP id 49AFE7FA05A; Thu, 24 Feb 2011 13:38:11 +0100 (CET) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 In-Reply-To: <8762saiki1.fsf@stupidchicken.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 62.127.194.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:136438 Archived-At: 2011-02-23 21:06, Chong Yidong skrev: > Adrian Robert 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.