unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Strange code in nsterm.m
Date: Mon, 01 Nov 2010 22:36:38 +0100	[thread overview]
Message-ID: <4CCF32E6.5000305@swipnet.se> (raw)
In-Reply-To: <83iq0g6c3l.fsf@gnu.org>



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.




      reply	other threads:[~2010-11-01 21:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01 20:08 Strange code in nsterm.m Eli Zaretskii
2010-11-01 21:36 ` Jan Djärv [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CCF32E6.5000305@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=eliz@gnu.org \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).