Module: wine Branch: master Commit: a472d39b7dee82ae0cbf67112495d381cecbad5e URL: http://source.winehq.org/git/wine.git/?a=commit;h=a472d39b7dee82ae0cbf671124...
Author: Ken Thomases ken@codeweavers.com Date: Sun Feb 10 19:09:18 2013 -0600
winemac: Prevent Cocoa from consuming certain key-down events.
---
dlls/winemac.drv/cocoa_window.m | 29 +++++++++++++++++++---------- 1 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index 218ba3f..4371110 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -679,18 +679,27 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
- (void) sendEvent:(NSEvent*)event { - if ([event type] == NSLeftMouseDown) + /* NSWindow consumes certain key-down events as part of Cocoa's keyboard + interface control. For example, Control-Tab switches focus among + views. We want to bypass that feature, so directly route key-down + events to -keyDown:. */ + if ([event type] == NSKeyDown) + [[self firstResponder] keyDown:event]; + else { - /* Since our windows generally claim they can't be made key, clicks - in their title bars are swallowed by the theme frame stuff. So, - we hook directly into the event stream and assume that any click - in the window will activate it, if Wine and the Win32 program - accept. */ - if (![self isKeyWindow] && !self.disabled && !self.noActivate) - [NSApp windowGotFocus:self]; - } + if ([event type] == NSLeftMouseDown) + { + /* Since our windows generally claim they can't be made key, clicks + in their title bars are swallowed by the theme frame stuff. So, + we hook directly into the event stream and assume that any click + in the window will activate it, if Wine and the Win32 program + accept. */ + if (![self isKeyWindow] && !self.disabled && !self.noActivate) + [NSApp windowGotFocus:self]; + }
- [super sendEvent:event]; + [super sendEvent:event]; + } }