From b038b6baf69229d4dc805c19c884c88c6c36ad0e Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Fri, 13 Jul 2012 12:41:26 +0100 Subject: [PATCH] Fixed: browser propagation control when not in browser. This would lead to a `[CPPlatformWindow _willPropagateCurrentDOMEvent] unrecognized selector sent to instance` error if an event was sent in a non DOM environment. --- AppKit/CPApplication.j | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AppKit/CPApplication.j b/AppKit/CPApplication.j index b10113d28f..b57c26a98d 100644 --- a/AppKit/CPApplication.j +++ b/AppKit/CPApplication.j @@ -576,27 +576,33 @@ CPRunContinuesResponse = -1002; { _currentEvent = anEvent; +#if PLATFORM(DOM) var willPropagate = [[[anEvent window] platformWindow] _willPropagateCurrentDOMEvent]; // temporarily pretend we won't propagate the event. we'll restore the saved value later // we do this outside the if so that changes user code might make in _handleKeyEquiv. are preserved [[[anEvent window] platformWindow] _propagateCurrentDOMEvent:NO]; +#endif // Check if this is a candidate for key equivalent... if ([anEvent _couldBeKeyEquivalent] && [self _handleKeyEquivalent:anEvent]) { +#if PLATFORM(DOM) var characters = [anEvent characters], modifierFlags = [anEvent modifierFlags]; // Unconditionally propagate on these keys to solve browser copy paste bugs if ((characters == "c" || characters == "x" || characters == "v") && (modifierFlags & CPPlatformActionKeyMask)) [[[anEvent window] platformWindow] _propagateCurrentDOMEvent:YES]; +#endif return; } +#if PLATFORM(DOM) // if we make it this far, then restore the original willPropagate value [[[anEvent window] platformWindow] _propagateCurrentDOMEvent:willPropagate]; +#endif if (_eventListeners.length) {