Commit a472d39b authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Prevent Cocoa from consuming certain key-down events.

parent 3748c393
......@@ -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];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment