We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3107

Summary: Patch: OSX - Process events in SDLApplication to fix integration with CEF.
Product: SDL Reporter: John Wordsworth <john>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.3   
Hardware: x86   
OS: Mac OS X (All)   
Attachments: Patch to OSX input event management to work with CEF.

Description John Wordsworth 2015-08-27 09:28:23 UTC
Created attachment 2254 [details]
Patch to OSX input event management to work with CEF.

While attempting to integrate CEF (Browser) into an SDL application, we noticed that there were problems on OS X where approximately 50% of the input events were essentially being lost - even when we were using off-screen rendering in CEF and passing through input events manually.

It appears that this problem has been around for a while (see: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=11141).

Please consider the following patch that fixes this issue. Instead of processing events directly after calling [NSApp nextEventMatchingMask:...] we now pass these events down to NSApp, for processing by an overloaded sendEvent: method. Chromium also forwards events to NSApp in the same way, which means we don't miss events, even if they were originally dequeued by CEF.

Apologies if I have not submitted this request in the correct manner - it is my first patch for SDL!
Comment 1 Sam Lantinga 2016-10-01 21:35:11 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/5eac139165bc