Re: Continue application processing with mouse down on a menu
Re: Continue application processing with mouse down on a menu
- Subject: Re: Continue application processing with mouse down on a menu
- From: Lee Ann Rucker <email@hidden>
- Date: Mon, 28 Sep 2015 20:06:13 +0000
- Thread-topic: Continue application processing with mouse down on a menu
On Sep 26, 2015, at 10:03 AM, Eric Schlegel <email@hidden> wrote:
>
>> On Sep 26, 2015, at 9:51 AM, Jens Alfke <email@hidden> wrote:
>>
>>
>>> On Sep 26, 2015, at 7:11 AM, Programmingkid <email@hidden> wrote:
>>>
>>> It has seem like a rule that has been in place forever that an application pauses processing when the mouse is down on a menu. Is there a way to make the application continue processing even with the mouse down?
>>
>> No, that was only true in the old "classic" OS. In OS X, menu tracking runs in a different thread and doesn't block the app's thread(s).
>
> No, that’s not true. Menu tracking runs on the main thread and does block other event handling on the main thread for the app that owns the menus. This is exactly the same as any other modal event tracking, such as pushing on a button, which also blocks other event processing on the main thread.
>
> However, there are the usual ways around this:
>
> - an event loop timer (using NSEventTrackingRunLoopMode)
> - using a separate thread, dispatch queue, etc.
> - using a separate process if necessary
>
> -eric
I would really really like my NSStatusItem to be able to process whatever it takes to let it think my menu is a key window so I can process key events in the search field and the rest of the menu - being key seems to depend the app being active and activateIgnoringOtherApps doesn’t get processed until the menu tracking is done. It works if the NSStatusItem uses an NSWindow, but not if it puts its contents in an NSMenu. (This is why the menubar slides away in fullscreen while my “menu” is still up; it’s not a menu.)
_______________________________________________
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