Re: Not seeing rightMouseDown: - what are the docs actually saying ?
Re: Not seeing rightMouseDown: - what are the docs actually saying ?
- Subject: Re: Not seeing rightMouseDown: - what are the docs actually saying ?
- From: Aandi Inston via Cocoa-dev <email@hidden>
- Date: Tue, 22 Oct 2019 01:01:19 +0100
Thank you very much for taking the time to build a test and make a reply.
I don't (in general) actually have custom subviews. The clicks were tested
(among other places) in parts of the NSWindow to which I have not
explicitly added content, as well as standard classes like NSBox. I was
suggesting I might have to make subclassed NSViews to pick up
rightMouseDown: events. But is it even knowable what NSViews lay between a
click and a window? Most obviously there is the [NSWindow contentView], but
some other view types may contain their own subviews which could receive
events.
I build the 32-bit plug-in with XCode 9.2, link with SDK 10.13 and
deployment target 10.7. So certainly it's linked on macOS 10.7 or later.
But I rather suspect that the "linked on" which matters is the host app,
which otool shows (for the most recent) as
cmd LC_VERSION_MIN_MACOSX
version 10.6
sdk n/a
I suspect that this app may not pass whatever the " linked on macOS 10.7 or
later" test is looking for, and my plug-in cannot change the behaviour of
Cocoa classes it inherits from the app.
Rather than chase down all the NSViews for which I might need to create
subclasses, I think the alternative of using rightMouseUp: seems to work
well enough on both 16 and 32 bits. So, I'm happy to consider this closed.
Thanks again.
On Mon, 21 Oct 2019 at 20:17, Richard Charles <email@hidden> wrote:
> > On Oct 20, 2019, at 8:27 AM, Aandi Inston <email@hidden> wrote:
> >
> > We have a workaround, which is to move our right click processing onto
> MouseUp, which is passed up the responder chain as we wish in both 32 and
> 64 bit systems. But I remain curious as to what the docs are actually
> telling me.
>
> From NSResponder documentation.
>
> "Prior to OS X v10.7, NSView did not pass unhandled rightMouseDown(with:)
> events up the responder chain. In macOS 10.7 and later, NSView passes
> rightMouseDown(with:) events up the responder chain if AppKit doesn’t find
> an associated context menu to display for the view. To avoid binary
> compatibility issues, this new behavior is enabled only for applications
> linked on macOS 10.7 or later."
>
> Sounds straight forward to me. Perhaps you need to read it again.
>
> I created a new app with Xcode 9.2 and linked to 10.13. Created a custom
> view and custom window with rightMouseDown logging. Built the app for 32
> bit and 64 bit. An unhandled rightMouseDown is passed promptly from view to
> window in both cases.
>
> Also the NSView documentation states.
>
> "Because NSView changes the default behavior of the rightMouseDown:
> method, you should call super when implementing that method in your custom
> subclasses."
>
> Are you doing this?
>
> --Richard Charles
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden