[Top][All Lists]

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

Re: Strange code in nsterm.m

From: Jan Djärv
Subject: Re: Strange code in nsterm.m
Date: Mon, 01 Nov 2010 22:36:38 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv: Gecko/20101004 Thunderbird/3.1.5

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)<<<<<<<<<<<<<<<<<<<<<<<

     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

     if (!dpyinfo || !emacsframe)

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 via email to

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