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: Strange code in nsterm.m Date: Mon, 01 Nov 2010 22:36:38 +0100 Message-ID: <4CCF32E6.5000305@swipnet.se> References: <83iq0g6c3l.fsf@gnu.org> 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 1288647553 30520 80.91.229.12 (1 Nov 2010 21:39:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 1 Nov 2010 21:39:13 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 01 22:39:09 2010 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 1PD25t-0003uT-AG for ged-emacs-devel@m.gmane.org; Mon, 01 Nov 2010 22:39:09 +0100 Original-Received: from localhost ([127.0.0.1]:50271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PD23o-00059B-6V for ged-emacs-devel@m.gmane.org; Mon, 01 Nov 2010 17:37:00 -0400 Original-Received: from [140.186.70.92] (port=34212 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PD23f-000581-24 for emacs-devel@gnu.org; Mon, 01 Nov 2010 17:36:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PD23d-0007Kz-Tg for emacs-devel@gnu.org; Mon, 01 Nov 2010 17:36:50 -0400 Original-Received: from smtprelay-h22.telenor.se ([195.54.99.197]:40906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PD23c-0007Kb-Kg; Mon, 01 Nov 2010 17:36:48 -0400 Original-Received: from ipb4.telenor.se (ipb4.telenor.se [195.54.127.167]) by smtprelay-h22.telenor.se (Postfix) with ESMTP id 6E1E2E8C02; Mon, 1 Nov 2010 22:36:39 +0100 (CET) X-SENDER-IP: [85.225.45.100] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtUxACfPzkxV4S1kPGdsb2JhbACHbZl0DAEBAQE1Lb53hUUEjVw X-IronPort-AV: E=Sophos;i="4.58,276,1286143200"; d="scan'208";a="1686698682" Original-Received: from c-642de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.100]) by ipb4.telenor.se with ESMTP; 01 Nov 2010 22:36:39 +0100 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 7F8E97FA05A; Mon, 1 Nov 2010 22:36:38 +0100 (CET) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.11) Gecko/20101004 Thunderbird/3.1.5 In-Reply-To: <83iq0g6c3l.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:132254 Archived-At: Eli Zaretskii skrev 2010-11-01 21.08: > Here's mouseExited from nsterm.m: > > - (void)mouseExited: (NSEvent *)theEvent > { > NSPoint p = [self convertPoint: [theEvent locationInWindow] fromView: nil]; > NSRect r; > struct ns_display_info *dpyinfo > = emacsframe ? FRAME_NS_DISPLAY_INFO (emacsframe) : NULL; > > NSTRACE (mouseExited); > > if (dpyinfo || !emacsframe)<<<<<<<<<<<<<<<<<<<<<<< > return; > > last_mouse_movement_time = EV_TIMESTAMP (theEvent); > > if (emacsframe == dpyinfo->mouse_face_mouse_frame) > { > clear_mouse_face (dpyinfo); > dpyinfo->mouse_face_mouse_frame = 0; > } > } > > Isn't the line marked with<<<<<<<<<<<<<<<<<<<<<<< wrong? It should > say > > if (!dpyinfo || !emacsframe) > return; > > right? Because if dpyinfo is NULL, we cannot dereference it two lines > after that. Am I missing something? No your analysis is correct. However, mouseExited doesn't seem to get called on OSX. Not sure if the mouse face gets cleared someplace else. Initial testing indicates that it does, probably when loosing focus. Jan D.