]> git.eshelyaron.com Git - emacs.git/commitdiff
Backport: Fix for 18993.
authorJan D <jan.h.d@swipnet.se>
Sat, 15 Nov 2014 18:20:37 +0000 (19:20 +0100)
committerJan D <jan.h.d@swipnet.se>
Sat, 15 Nov 2014 18:20:37 +0000 (19:20 +0100)
* nsterm.m (ns_send_appdefined): Check for application defined
event on Cocoa (Bug#18993).  Backport from trunk.

src/ChangeLog
src/nsterm.m

index 2ea5d29d3b28944b19f048bb866854c03b92ff8f..4aa9958a52f3a28d4146147998a8ca98effa6fe2 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-15  Jan Djärv  <jan.h.d@swipnet.se>
+
+        * nsterm.m (ns_send_appdefined): Check for application defined
+        event on Cocoa (Bug#18993).  Backport from trunk.
+
 2014-11-15  Eli Zaretskii  <eliz@gnu.org>
 
        * window.c (window_scroll_pixel_based): Avoid truncation/rounding
index b3a4e08e5f648e10ca879098e090e6f7279b084d..7e2d4beac6abd5a2b99560c96c5a9c60379ae061 100644 (file)
@@ -3434,6 +3434,21 @@ ns_send_appdefined (int value)
   /* Only post this event if we haven't already posted one.  This will end
        the [NXApp run] main loop after having processed all events queued at
        this moment.  */
+
+#ifdef NS_IMPL_COCOA
+  if (! send_appdefined)
+    {
+      /* OSX 10.10.1 swallows the AppDefined event we are sending ourselves
+         in certain situations (rapid incoming events).
+         So check if we have one, if not add one.  */
+      NSEvent *appev = [NSApp nextEventMatchingMask:NSApplicationDefinedMask
+                                          untilDate:[NSDate distantPast]
+                                             inMode:NSDefaultRunLoopMode
+                                            dequeue:NO];
+      if (! appev) send_appdefined = YES;
+    }
+#endif
+
   if (send_appdefined)
     {
       NSEvent *nxev;