From a911292c85f7069d2caabcb677ed716a04227526 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sat, 15 May 2010 10:53:09 -0700 Subject: [PATCH] XQuartz: Don't trust deltaXY for middle mouse clicks. The middle mouse clicks return erroneous values after returning from Fast User Switching. http://xquartz.macosforge.org/trac/ticket/389 Signed-off-by: Martin Otte Reviewed-by: Jeremy Huddleston Reviewed-by: Edward Moy Signed-off-by: Jeremy Huddleston --- hw/xquartz/X11Application.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index c9a0d669f..ed9fb32b1 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -1038,12 +1038,15 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe location.x += frame.origin.x; location.y += frame.origin.y; lastpt = location; - } else if(isTabletEvent) { + } else if(isTabletEvent || [e type] == NSOtherMouseDown || [e type] == NSOtherMouseUp) { // NSEvents for tablets are not consistent wrt deltaXY between events, so we cannot rely on that // Thus tablets will be subject to the warp-pointer bug worked around by the delta, but tablets // are not normally used in cases where that bug would present itself, so this is a fair tradeoff // deltaX and deltaY are incorrect for NSMouseMoved, NSTabletPointEventSubtype // http://xquartz.macosforge.org/trac/ticket/288 + // The deltaXY for middle click events also appear erroneous after fast user switching + // deltaX and deltaY are incorrect for NSOtherMouseDown and NSOtherMouseUp after FUS + // http://xquartz.macosforge.org/trac/ticket/389 location = [e locationInWindow]; lastpt = location; } else {