From dd4c1c15b5f4f178f55942ca6ffa63027fcb20df Mon Sep 17 00:00:00 2001 From: "gtm.daemon" Date: Tue, 10 Nov 2009 19:00:55 +0000 Subject: [Author: dmaclach] Put some better restrictions on the Animations so they don't happen by accident. Imitates the minimize window behaviour. R=thomasvl DELTA=15 (8 added, 0 deleted, 7 changed) --- AppKit/GTMNSAnimation+Duration.m | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'AppKit/GTMNSAnimation+Duration.m') diff --git a/AppKit/GTMNSAnimation+Duration.m b/AppKit/GTMNSAnimation+Duration.m index 327a349..884cd32 100644 --- a/AppKit/GTMNSAnimation+Duration.m +++ b/AppKit/GTMNSAnimation+Duration.m @@ -20,13 +20,19 @@ NSTimeInterval GTMModifyDurationBasedOnCurrentState(NSTimeInterval duration) { NSEvent *event = [NSApp currentEvent]; - NSUInteger modifiers = [event modifierFlags]; - if (modifiers & NSShiftKeyMask) { - duration *= 5.0; - } - // These are additive, so shift+control returns 10 * duration. - if (modifiers & NSControlKeyMask) { - duration *= 2.0; + if ([event type] == NSLeftMouseUp) { + NSUInteger modifiers = [event modifierFlags]; + if (!(modifiers & (NSAlternateKeyMask | + NSCommandKeyMask | + NSFunctionKeyMask))) { + if (modifiers & NSShiftKeyMask) { + duration *= 5.0; + } + // These are additive, so shift+control returns 10 * duration. + if (modifiers & NSControlKeyMask) { + duration *= 2.0; + } + } } return duration; } -- cgit v1.2.3