[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] [emacs] 01/01: Backport: Fix for 18993.
From: |
Jan D. |
Subject: |
[Emacs-diffs] [emacs] 01/01: Backport: Fix for 18993. |
Date: |
Sat, 15 Nov 2014 18:20:47 +0000 |
jhd pushed a commit to branch emacs-24
in repository emacs.
commit a6b42789b55688822b762a20865c8d2c812125b9
Author: Jan D <address@hidden>
Date: Sat Nov 15 19:20:37 2014 +0100
Backport: Fix for 18993.
* nsterm.m (ns_send_appdefined): Check for application defined
event on Cocoa (Bug#18993). Backport from trunk.
---
src/ChangeLog | 5 +++++
src/nsterm.m | 15 +++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index 2ea5d29..4aa9958 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-15 Jan Djärv <address@hidden>
+
+ * nsterm.m (ns_send_appdefined): Check for application defined
+ event on Cocoa (Bug#18993). Backport from trunk.
+
2014-11-15 Eli Zaretskii <address@hidden>
* window.c (window_scroll_pixel_based): Avoid truncation/rounding
diff --git a/src/nsterm.m b/src/nsterm.m
index b3a4e08..7e2d4be 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -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;