> On 29 Oct 2014, at 15:21, Steve Mills <sjmi...@mac.com> wrote:
> 
> Is there no way to turn off the annoying and dangerous behavior of views 
> accepting background clicks, short of subclassing every view in a window and 
> returning NO from acceptsFirstMouse:? The only docs I can find still state 
> the opposite of what happens these days 
> (https://developer.apple.com/library/mac/documentation/cocoa/conceptual/eventoverview/HandlingMouseEvents/HandlingMouseEvents.html#//apple_ref/doc/uid/10000060i-CH6-SW17):
> 
> "By default, a mouse-down event in a window that isn’t the key window simply 
> brings the window forward and makes it key; the event isn’t sent to the 
> NSView object over which the mouse click occurs."
> 
> That's not what I get. Background clicks cause the window to become key AND 
> the click is handled by the view that was clicked. I don't want that. The 
> window should only become key and the clicked view should ignore the event.
> 
Hmm.
I created a sample project with a single NSWindow and content view subclass 
like so:
@implementation TestView

- (void)mouseDown:(NSEvent *)theEvent
{
    NSLog(@"Mouse down");
}

/*
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
{
    return YES;
} */

@end

It seems to behave as the docs suggest on OS X 10.9.
Perhaps your app has some additional event handling in place.

Jonathan
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to