unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Bob Halley <halley@play-bow.org>
Cc: 23924@debbugs.gnu.org
Subject: bug#23924: [PATCH] Only check for AppDefined events in OS X 10.10 (bug#23924)
Date: Wed, 13 Jul 2016 22:03:45 +0100	[thread overview]
Message-ID: <20160713210345.GA89533@breton.holly.idiocy.org> (raw)
In-Reply-To: <39AC2AF3-C87A-4743-803D-155A9E35081A@play-bow.org>

* src/nsterm.m (ns_send_appdefined): Limit bugfix for bug#18993 to OS X
10.10.
---
 src/nsterm.m | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/nsterm.m b/src/nsterm.m
index a6160ed..a7e2649 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3942,16 +3942,21 @@ overwriting cursor (usually when cursor on a tab) */
        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;
+  if ([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)])
+    {
+      NSOperatingSystemVersion v = [[NSProcessInfo processInfo] operatingSystemVersion];
+
+      if (! send_appdefined && v.majorVersion == 10 && v.minorVersion == 10)
+        {
+          /* 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
 
-- 
Hi Bob, can you try applying this patch? The fix was originally put in
place for bug#18993 which seems to be specific to OS X 10.10 (or at
least, I can't replicate it here in 10.11) so I've limited the fix to
that specific version and completely removed it for everything else.

Hopefully it's not going to break everything, but it seems OK here.
-- 
Alan Third





  parent reply	other threads:[~2016-07-13 21:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-09  0:20 bug#23924: 25.1.50; Emacs NSInternalInconsistencyException on macos Sierra developer beta 2 Bob Halley
2016-07-10 10:10 ` Alan Third
2016-07-10 16:06   ` Bob Halley
2016-07-10 16:43     ` Alan Third
2016-07-10 17:13       ` Bob Halley
2016-07-10 19:24       ` Bob Halley
2016-07-11 13:13       ` Bob Halley
2016-07-11 15:13         ` Bob Halley
2016-07-13 21:03         ` Alan Third [this message]
2016-07-13 23:08           ` bug#23924: [PATCH] Only check for AppDefined events in OS X 10.10 (bug#23924) Bob Halley
2016-07-17 14:15             ` Alan Third
2016-07-20 18:35               ` Bob Halley
2016-07-20 19:31                 ` Alan Third
2016-07-20 21:09                 ` bug#23924: [PATCH] Post AppDefined events from the main thread ONLY (bug#23934) Alan Third
2016-07-21 13:20                   ` Bob Halley
2016-07-22 21:10                     ` Bob Halley
2016-07-22 21:42                       ` Alan Third
     [not found] <FD3A3DF6-F8E6-41B9-BAE9-61D99C64941D@gmail.com>
2016-07-18 13:54 ` bug#23924: [PATCH] Only check for AppDefined events in OS X 10.10 (bug#23924) Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160713210345.GA89533@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=23924@debbugs.gnu.org \
    --cc=halley@play-bow.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).