adium 2847:ecda51fe4614: Prevent infinitely forwarding navigatio...
commits at adium.im
commits at adium.im
Sun Nov 1 16:15:56 UTC 2009
details: http://hg.adium.im/adium/rev/ecda51fe4614
revision: 2847:ecda51fe4614
author: Zachary West <zacw at adium.im>
date: Sun Nov 01 11:15:19 2009 -0500
Prevent infinitely forwarding navigation events. Fixes #13251.
diffs (28 lines):
diff -r 28d2f716a225 -r ecda51fe4614 Plugins/WebKit Message View/ESWebView.m
--- a/Plugins/WebKit Message View/ESWebView.m Sat Oct 31 23:36:14 2009 -0400
+++ b/Plugins/WebKit Message View/ESWebView.m Sun Nov 01 11:15:19 2009 -0500
@@ -93,9 +93,22 @@
//into this view.
- (void)keyDown:(NSEvent *)theEvent
{
+ BOOL forwarded = YES;
+
if (shouldForwardEvents) {
- [self forwardSelector:@selector(keyDown:) withObject:theEvent];
- } else {
+ unichar inChar = [[theEvent charactersIgnoringModifiers] characterAtIndex:0];
+
+ // Don't forward navigation key events. If we're receiving them, it's because
+ // the frame itself didn't support them.
+ if (inChar != NSUpArrowFunctionKey && inChar != NSDownArrowFunctionKey &&
+ inChar != NSPageUpFunctionKey && inChar != NSPageDownFunctionKey)
+ {
+ [self forwardSelector:@selector(keyDown:) withObject:theEvent];
+ forwarded = YES;
+ }
+ }
+
+ if (!forwarded) {
[super keyDown:theEvent];
}
}
More information about the commits
mailing list