XQuartz: Don't use deltaXY for determining pointer location on scroll events
<rdar://problem/7989690> Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Edward Moy <emoy@apple.com>
This commit is contained in:
parent
a911292c85
commit
ecfeabec8d
|
@ -1030,7 +1030,24 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
||||||
if(isMouseOrTabletEvent) {
|
if(isMouseOrTabletEvent) {
|
||||||
static NSPoint lastpt;
|
static NSPoint lastpt;
|
||||||
NSWindow *window = [e window];
|
NSWindow *window = [e window];
|
||||||
NSRect screen = [[[NSScreen screens] objectAtIndex:0] frame];;
|
NSRect screen = [[[NSScreen screens] objectAtIndex:0] frame];
|
||||||
|
BOOL hasUntrustedPointerDelta;
|
||||||
|
|
||||||
|
// 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
|
||||||
|
// <rdar://problem/7111003> deltaX and deltaY are incorrect for NSMouseMoved, NSTabletPointEventSubtype
|
||||||
|
// http://xquartz.macosforge.org/trac/ticket/288
|
||||||
|
hasUntrustedPointerDelta = isTabletEvent;
|
||||||
|
|
||||||
|
// The deltaXY for middle click events also appear erroneous after fast user switching
|
||||||
|
// <rdar://problem/7979468> deltaX and deltaY are incorrect for NSOtherMouseDown and NSOtherMouseUp after FUS
|
||||||
|
// http://xquartz.macosforge.org/trac/ticket/389
|
||||||
|
hasUntrustedPointerDelta = hasUntrustedPointerDelta || [e type] == NSOtherMouseDown || [e type] == NSOtherMouseUp;
|
||||||
|
|
||||||
|
// The deltaXY for scroll events correspond to the scroll delta, not the pointer delta
|
||||||
|
// <rdar://problem/7989690> deltaXY for wheel events are being sent as mouse movement
|
||||||
|
hasUntrustedPointerDelta = hasUntrustedPointerDelta || [e type] == NSScrollWheel;
|
||||||
|
|
||||||
if (window != nil) {
|
if (window != nil) {
|
||||||
NSRect frame = [window frame];
|
NSRect frame = [window frame];
|
||||||
|
@ -1038,15 +1055,7 @@ static inline int ensure_flag(int flags, int device_independent, int device_depe
|
||||||
location.x += frame.origin.x;
|
location.x += frame.origin.x;
|
||||||
location.y += frame.origin.y;
|
location.y += frame.origin.y;
|
||||||
lastpt = location;
|
lastpt = location;
|
||||||
} else if(isTabletEvent || [e type] == NSOtherMouseDown || [e type] == NSOtherMouseUp) {
|
} else if(hasUntrustedPointerDelta) {
|
||||||
// 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
|
|
||||||
// <rdar://problem/7111003> 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
|
|
||||||
// <rdar://problem/7979468> deltaX and deltaY are incorrect for NSOtherMouseDown and NSOtherMouseUp after FUS
|
|
||||||
// http://xquartz.macosforge.org/trac/ticket/389
|
|
||||||
location = [e locationInWindow];
|
location = [e locationInWindow];
|
||||||
lastpt = location;
|
lastpt = location;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user