Dear experts,

I’m encountering a serious (to me) problem in Yosemite where events are sent to 
the event queue of my application, but never received.

I’m posting events of type NSApplicationDefined using [NSApp 
postEvent:atStart:].  Normally, these are received in a run loop, which uses 
the events to terminate and do something else.  Because it does not terminate, 
the application becomes unresponsive.

This worked fine prior to 10.10, and it normally works fine in 10.10, except 
when a user causes several (other) events to be added to the queue in rapid 
succession.  Double-clicking a toolbar icon reliably reproduces the problem.

Testing my code, I made sure I numbered and logged every one of those 
AppDefined events going in.  I also log every event seen by the NSApplication’s 
sendEvent function.  After the rapid inputs take place, those AppDefined events 
clearly are no longer received.

The occurs whether I implement my own “run” function or use the default one. I 
made sure that there is no other call to “run” or 
“nextEventMatchingMask:untilDate:..” in the application.  A workaround setting 
a timeout with the untilDate argument to nextEventMatchingMask addresses the 
issue temporarily.

I’m told by users that the problem started in a Yosemite pre-release version, 
halfway through the public test phase.

Is there any other way in Cocoa to clear the event loop or to receive events?  
Can you think of any potential actions in my code that could cause this, as 
opposed to a bug in 10.10?

Thanks,
David




To reproduce:

download binary or source code from:
https://github.com/davidswelt/aquamacs-emacs/releases/tag/Aquamacs-3.1a

Start up, then double-click the “search” icon.

Event loop is in [EmacsApp run] method in nsterm.m:4774. 
This loop does not exit because the marker event isn’t retrieved.

Event is sent in ns_send_appdefined(), nsterm.m:3647

Events of this type are received in sendEvent: in nsterm.m:4805.
_______________________________________________

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