diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 061af6c29..cb12cb918 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -936,14 +936,7 @@ static void send_nsevent(NSEvent *e) { handle_mouse: pDev = darwinPointer; - if ([e type] == NSTabletPoint || [e subtype] == NSTabletPointEventSubtype) { - pressure = [e pressure]; - tilt_x = [e tilt].x; - tilt_y = [e tilt].y; - - pDev = darwinTabletCurrent; - } - + if([e subtype] == NSTabletProximityEventSubtype) { switch([e pointingDeviceType]) { case NSEraserPointingDevice: @@ -959,8 +952,25 @@ static void send_nsevent(NSEvent *e) { break; } + /* NSTabletProximityEventSubtype doesn't encode pressure ant tilt + * So we just pretend the motion was caused by the mouse. Hopefully + * we'll have a better solution for this in the future (like maybe + * NSTabletProximityEventSubtype will come from NSTabletPoint + * rather than NSMouseMoved. + pressure = [e pressure]; + tilt_x = [e tilt].x; + tilt_y = [e tilt].y; + pDev = darwinTabletCurrent; + */ + DarwinSendProximityEvents([e isEnteringProximity]?ProximityIn:ProximityOut, pointer_x, pointer_y); + } + + if ([e type] == NSTabletPoint || [e subtype] == NSTabletPointEventSubtype) { + pressure = [e pressure]; + tilt_x = [e tilt].x; + tilt_y = [e tilt].y; pDev = darwinTabletCurrent; }