emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113481: * nsterm.m (sendEvent:): Skip mouse moved i


From: Jan D.
Subject: [Emacs-diffs] trunk r113481: * nsterm.m (sendEvent:): Skip mouse moved if no dialog and no Emacs
Date: Sun, 21 Jul 2013 11:47:12 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113481
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/14895
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Sun 2013-07-21 13:47:07 +0200
message:
  * nsterm.m (sendEvent:): Skip mouse moved if no dialog and no Emacs
  frame have focus.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/nsterm.m                   nsterm.m-20091113204419-o5vbwnq5f7feedwu-8747
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-07-21 06:53:47 +0000
+++ b/src/ChangeLog     2013-07-21 11:47:07 +0000
@@ -1,3 +1,8 @@
+2013-07-21  Jan Djärv  <address@hidden>
+
+       * nsterm.m (sendEvent:): Skip mouse moved if no dialog and no Emacs
+       frame have focus (Bug#14895).
+
 2013-07-21  Paul Eggert  <address@hidden>
 
        Avoid vfork-related deadlock more cleanly.

=== modified file 'src/nsterm.m'
--- a/src/nsterm.m      2013-07-19 01:24:35 +0000
+++ b/src/nsterm.m      2013-07-21 11:47:07 +0000
@@ -4416,6 +4416,7 @@
 {
   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 @@
         }
     }
 
+
+#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];
 }
 


reply via email to

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