Skip to content

Instantly share code, notes, and snippets.

@ehabkost
Created June 19, 2012 23:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehabkost/2957217 to your computer and use it in GitHub Desktop.
Save ehabkost/2957217 to your computer and use it in GitHub Desktop.
From 24b77f1f639727cb02cd0ef5b594aec94daeebfc Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@raisama.net>
Date: Tue, 19 Jun 2012 19:46:52 -0300
Subject: [PATCH 1/3] remove NX_NUMPROCS case
1) NX_NUMPROCS isn't supposed to be an event number, but just the number of
events from NX_FIRSTEVENT to NX_LASTEVENT
2) NX_NUMPROCS is > NX_LASTEVENT, so the "default:" branch already
handles it (and shows a warning)
Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
---
src/lib/platform/COSXScreen.cpp | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/src/lib/platform/COSXScreen.cpp b/src/lib/platform/COSXScreen.cpp
index 7a734eb..1ad6aa5 100644
--- a/src/lib/platform/COSXScreen.cpp
+++ b/src/lib/platform/COSXScreen.cpp
@@ -1855,8 +1855,6 @@ COSXScreen::handleCGInputEvent(CGEventTapProxy proxy,
// Unknown, forward it
return event;
break;
- case NX_NUMPROCS:
- break;
default:
LOG((CLOG_NOTE "unknown quartz event type: 0x%02x", type));
}
--
1.7.7.5 (Apple Git-26)
From 6a60372c8758aebf83df5c9322fbd534ae991a6a Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@raisama.net>
Date: Tue, 19 Jun 2012 19:52:53 -0300
Subject: [PATCH 2/3] don't ignore unknown events
Ignoring and filtering unknown events may have unknown consequences.
e.g.:
http://synergy-foss.org/spit/issues/details/3195/
By removing the hack, the behavior will be:
- the "default:" branch will be run, showing a warning with event ID
- the event will be filtered out if focus is on a different screen,
and will be not filtered if the server is the current screen
Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
---
src/lib/platform/COSXScreen.cpp | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/src/lib/platform/COSXScreen.cpp b/src/lib/platform/COSXScreen.cpp
index 1ad6aa5..ff97e12 100644
--- a/src/lib/platform/COSXScreen.cpp
+++ b/src/lib/platform/COSXScreen.cpp
@@ -1797,15 +1797,6 @@ COSXScreen::handleCGInputEvent(CGEventTapProxy proxy,
COSXScreen* screen = (COSXScreen*)refcon;
CGPoint pos;
- // Patch by Perceptum to ignore what seems to be an "Out of Bounds"
- // event that is emitted by touching the trackpad on a MacBook
- // Suspicion that it is related to the new Gestures trackpad
- // bryan@perceptum.biz
- if(type > NX_LASTEVENT) {
- LOG((CLOG_NOTE "Ignoring Out of Bounds Quartz Event type: 0x%02x [max 0x%02x]", type, NX_LASTEVENT));
- return NULL;
- }
-
switch(type) {
case kCGEventLeftMouseDown:
case kCGEventRightMouseDown:
--
1.7.7.5 (Apple Git-26)
From 1eba233069a4c2d911dd93e1c5d28f0638b68c9e Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@raisama.net>
Date: Tue, 19 Jun 2012 20:45:47 -0300
Subject: [PATCH 3/3] don't generate warnings for known trackpad-specific
events
The current behavior will be kept: events will be filtered out if the
screen doesn't have focus, and forwarded unchanged if it has focus.
Signed-off-by: Eduardo Habkost <ehabkost@raisama.net>
---
src/lib/platform/COSXScreen.cpp | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/lib/platform/COSXScreen.cpp b/src/lib/platform/COSXScreen.cpp
index ff97e12..a79708c 100644
--- a/src/lib/platform/COSXScreen.cpp
+++ b/src/lib/platform/COSXScreen.cpp
@@ -1846,6 +1846,13 @@ COSXScreen::handleCGInputEvent(CGEventTapProxy proxy,
// Unknown, forward it
return event;
break;
+ case 0x1d:
+ case 0x1e:
+ // Events known to be generated by trackpads and
+ // Magic Mouse on OS X Lion
+ // They will be simply forwarded, below, but only if
+ // the server screen has the focus
+ break;
default:
LOG((CLOG_NOTE "unknown quartz event type: 0x%02x", type));
}
--
1.7.7.5 (Apple Git-26)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment