| Summary: | OSX menus unresponsive to mouse input until focus lost & regained. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Devon Sean McCullough <libSDL> |
| Component: | events | Assignee: | Alex Szpakowski <amaranth72> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | jim.van.verth, philipp.wiesemann, sezeroz |
| Version: | 2.0.4 | ||
| Hardware: | x86 | ||
| OS: | Mac OS X 10.11 | ||
Maybe this is a similar problem like in bug #3365. (In reply to Philipp Wiesemann from comment #1) > Maybe this is a similar problem like in bug #3365. Very different as SDL_WaitEvent calls SDL_PumpEvents() every 10ms. Peace --Devon P.S. An initial 5s delay merely delays the black window's appearance, then the buggy behavior is unchanged. An initial PumpEvents before the delay merely gets a spinning beachball while waiting for the black window to appear, otherwise unchanged. Moving, minimizing and un-minimizing the window do not affect the bug. In all cases the menus appear at once but are unresponsive to mouse input until the window loses and then gains focus. The menus do respond to keyboard shortcuts at all times. Clover-Q, Clover-H and Clover-Alt-H always work. Hiding and un-hiding does not affect the bug. Delete Comment 3 line 3 please - obviously un-hiding gains focus. This might be related to the line [NSApp activateIgnoringOtherApps:YES] in Cocoa_RegisterApp(). Commenting it out allows the menu to activate -- assuming that the window activates. Without that line, it looks like file access (for me, anyway) prevents the window from activating. I tried moving this to after window creation (as another framework does), but it didn't make any difference. |
/// sdl-menu-bug.c // Menu Bar (Apple) sdl-menu-bug Window View // unresponsive until the app loses and regains focus. #include <SDL2/SDL.h> int main () { SDL_Init (SDL_INIT_EVERYTHING); SDL_CreateWindow ("SDL2 Menu Bug", 100, 100, 800, 600, SDL_WINDOW_OPENGL); for (;;) {SDL_Event event; SDL_WaitEvent (&event); if (event.type == SDL_QUIT) { SDL_Quit (); return 0; }}} // Local Variables: // compile-command: "cc -g -O0 -F/Library/Frameworks -I SDL2-includes sdl-menu-bug.c -o sdl-menu-bug -framework SDL2 -Wl,-framework,Cocoa && ./sdl-menu-bug" // End: