From: Jan Djärv Date: Sun, 21 Jul 2013 11:47:07 +0000 (+0200) Subject: * nsterm.m (sendEvent:): Skip mouse moved if no dialog and no Emacs X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1747 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=96c8b65ebd79360fdcf81786461805bb4377ca11;p=emacs.git * nsterm.m (sendEvent:): Skip mouse moved if no dialog and no Emacs frame have focus. Fixes: debbugs:14895 --- diff --git a/src/ChangeLog b/src/ChangeLog index e97e07aac60..fb2d875eb26 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-07-21 Jan Djärv + + * nsterm.m (sendEvent:): Skip mouse moved if no dialog and no Emacs + frame have focus (Bug#14895). + 2013-07-21 Paul Eggert Avoid vfork-related deadlock more cleanly. diff --git a/src/nsterm.m b/src/nsterm.m index f3c35e95bfe..61538798337 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4416,6 +4416,7 @@ ns_term_shutdown (int sig) { int type = [theEvent type]; NSWindow *window = [theEvent window]; + /* NSTRACE (sendEvent); */ /*fprintf (stderr, "received event of type %d\t%d\n", type);*/ @@ -4469,6 +4470,23 @@ ns_term_shutdown (int sig) } } + +#ifdef NS_IMPL_COCOA + /* If no dialog and none of our frames have focus and it is a move, skip it. + It is a mouse move in an auxillary menu, i.e. on the top right on OSX, + such as Wifi, sound, date or similar. + This prevents "spooky" highlightning in the frame under the menu. */ + if (type == NSMouseMoved && [NSApp modalWindow] == nil) + { + struct ns_display_info *di; + BOOL has_focus = NO; + for (di = x_display_list; ! has_focus && di; di = di->next) + has_focus = di->x_focus_frame != 0; + if (! has_focus) + return; + } +#endif + [super sendEvent: theEvent]; }