xserver: Branch 'xorg-server-1.4-apple' - 2 commits
Jeremy Huddleston
jeremyhu at kemper.freedesktop.org
Fri Aug 22 01:12:53 PDT 2008
hw/xquartz/X11Application.m | 40 ++++++++++++++++++----------------------
hw/xquartz/darwinEvents.c | 2 +-
2 files changed, 19 insertions(+), 23 deletions(-)
New commits:
commit f0351c2b80f30ae31f041798b84139141fc3d5a5
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Fri Aug 22 01:12:37 2008 -0700
XQuartz: Fixed bogus args to debug ErrorF
diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index cb4a214..15953e3 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -148,7 +148,7 @@ static void DarwinPressModifierKey(int pressed, int key) {
int keycode = DarwinModifierNXKeyToNXKeycode(key, 0);
if (keycode == 0) {
- ErrorF("DarwinPressModifierKey bad keycode: key=%d\n", pressed == KeyPress ? "press" : "release", key, keycode);
+ ErrorF("DarwinPressModifierKey bad keycode: key=%d\n", key);
return;
}
commit c286f2a718fdaf6ad10249b59abb20731da8d904
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Fri Aug 22 01:11:33 2008 -0700
XQuartz: Cleaned up mouse event translation a bit more.
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 359dbb1..5e1e96b 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -877,29 +877,25 @@ extern int darwin_modifier_flags; // darwinEvents.c
DarwinUpdateModKeys([e modifierFlags]);
switch ([e type]) {
- case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto check_subtype;
- case NSLeftMouseDown: ev_button=1; ev_type=ButtonPress; goto check_subtype;
- case NSOtherMouseDown: ev_button=2; ev_type=ButtonPress; goto check_subtype;
- case NSRightMouseDown: ev_button=3; ev_type=ButtonPress; goto check_subtype;
- case NSLeftMouseUp: ev_button=1; ev_type=ButtonRelease; goto check_subtype;
- case NSOtherMouseUp: ev_button=2; ev_type=ButtonRelease; goto check_subtype;
- case NSRightMouseUp: ev_button=3; ev_type=ButtonRelease; goto check_subtype;
- case NSLeftMouseDragged: ev_button=1; ev_type=MotionNotify; goto check_subtype;
- case NSOtherMouseDragged: ev_button=2; ev_type=MotionNotify; goto check_subtype;
- case NSRightMouseDragged: ev_button=3; ev_type=MotionNotify; goto check_subtype;
-
- check_subtype:
- if ([e subtype] != NSTabletPointEventSubtype)
- goto handle_mouse;
- // fall through to get tablet data
-
- case NSTabletPoint:
- ev_type = MotionNotify;
- pressure = [e pressure];
- tilt_x = [e tilt].x;
- tilt_y = [e tilt].y;
- // fall through to normal mouse handling
+ case NSLeftMouseDown: ev_button=1; ev_type=ButtonPress; goto handle_mouse;
+ case NSOtherMouseDown: ev_button=2; ev_type=ButtonPress; goto handle_mouse;
+ case NSRightMouseDown: ev_button=3; ev_type=ButtonPress; goto handle_mouse;
+ case NSLeftMouseUp: ev_button=1; ev_type=ButtonRelease; goto handle_mouse;
+ case NSOtherMouseUp: ev_button=2; ev_type=ButtonRelease; goto handle_mouse;
+ case NSRightMouseUp: ev_button=3; ev_type=ButtonRelease; goto handle_mouse;
+ case NSLeftMouseDragged: ev_button=1; ev_type=MotionNotify; goto handle_mouse;
+ case NSOtherMouseDragged: ev_button=2; ev_type=MotionNotify; goto handle_mouse;
+ case NSRightMouseDragged: ev_button=3; ev_type=MotionNotify; goto handle_mouse;
+ case NSMouseMoved: ev_button=0; ev_type=MotionNotify; goto handle_mouse;
+ case NSTabletPoint: ev_button=0; ev_type=MotionNotify; goto handle_mouse;
+
handle_mouse:
+ if ([e type] == NSTabletPoint || [e subtype] == NSTabletPointEventSubtype) {
+ pressure = [e pressure];
+ tilt_x = [e tilt].x;
+ tilt_y = [e tilt].y;
+ }
+
DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y,
pressure, tilt_x, tilt_y);
break;
More information about the xorg-commit
mailing list