![]() |
|
Patch for 4.2/4.4 to allow keyboard input to non-Allegro windows on OS X |
Francis Devereux
Member #11,413
October 2009
|
Hi, I'm working on a Mac OS X GUI for a cross-platform app that uses Allegro (the app is RPCEmu and my mercurial repo with the OS X GUI is at http://fe4e.ath.cx/hg/rpcemu-spoon-fjd). Allegro 4.2 (I've used 4.2.2 and 4.2.3) and 4.4 don't allow keyboard events to get to any windows in the application apart from the main Allegro window in a Cocoa application using Allegro. The attached patch, which works with both 4.2.3 and 4.4, allows keyboard events to go to other windows when the Allegro window does not have focus. I'm fairly new to Allegro so I don't know what the usual procedure is with patches. What's the chance of this patch being applied and is there anything else I can do to do to help? The OS X port of Allegro creates a secondary thread for the application's main() function, whereas the Windows port doesn't do this AFAICT. This means that on OS X code that runs in response to GUI events needs to use locks to protect data that is shared with the Allegro part of the app. This is not necessary on Windows because the GUI runs in the same thread as the Allegro stuff. Francis |
Peter Wang
Member #23
April 2000
|
The patch looks okay to me, but that's only by looking. If you think it's fine I can commit it to 4.4 and wait for Mac users to complain, probably when 4.4.0rc2 is released. The usual procedure is to submit it to the [AD] list but here is fine for small or one-off patches.
|
Francis Devereux
Member #11,413
October 2009
|
Yes, please can you apply it to 4.4. I have been using it for a few months and haven't found any problems with it (famous last words I've updated the patch with some documentation (attached). |
Peter Wang
Member #23
April 2000
|
Ok, done!
|
Francis Devereux
Member #11,413
October 2009
|
Thanks |
|