| Summary: | SDL_ShowCursor(1) doesn't work sometimes? | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Vern Jensen <vern> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | trivial | ||
| Priority: | P2 | CC: | buckyballreaction |
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | Mac OS X (All) | ||
|
Description
Vern Jensen
2011-03-28 10:07:06 UTC
How are you hiding the cursor? SDL is using cocoa cursor support, which doesn't work well if mixed with carbon cursor calls. I'm hiding it using SDL_ShowCursor(0). The only Carbon calls I make are to open a resource fork, and show a dialog box. Prior to that, NO Carbon calls are made. The Carbon additions were only made very recently, so the program is 99% SDL / OpenGL. Carbon headers are only included in two source code files -- files that handle dialog boxes. But like I said, it's a special case that maybe shouldn't be considered a bug. Feel free to mark it as "Resolved" if you want. Just thought I'd mention it. Can you attach a simple test case? Thanks! I'll try to get a text case to you within a week or so. In the mean time, I've discovered another, somewhat related, minor problem: 1) Push and hold a key. 2) Have program display a Carbon dialog box (such as Open File Navigation) while the key is still down. Release the key while the dialog box is visible. 3) Dismiss carbon dialog box. 4) Push the same key. When SDL reports the keyDown event, it reports the keyRepeat as being true. This is because, from SDL's perspective, the key was never released. (It was released while "Carbon" had control of events.) I've mostly worked around this for now. I'm guessing there's not much you can do about it. But if there is... it'd be nice to have fixed. Just to add another simple test case for which I think is the same issue: 1. Start and SDL application 2. CMD + TAB to another window 3. CMD + TAB back 4. The cursor is gone! As a workaround, I've found that calling the following in each of SDL_WINDOWEVENT_FOCUS_LOST and SDL_WINDOWEVENT_FOCUS_GAINED seems to correct the issue: SDL_ShowCursor(0); SDL_ShowCursor(1); Thanks Can you verify whether this is fixed in the current snapshot? http://www.libsdl.org/tmp/SDL-2.0.zip Hi, I just tested this with rev ad1ee23309ca. It is fixed to me. The mouse cursor does reappear properly. However, (and this may be a new bug,) the mouse is completely inoperable. Movement does not map properly to the cursor in-game (very erratic) and no clicks are registered. Thanks for verifying this issue! Feel free to report a separate bug for that, if you still see it once you've installed SDL with the latest headers and completely rebuilt your application with it. There was an event structure change that would cause the behavior you're seeing if you haven't rebuilt with the latest headers. Yep. That was it. I needed to fully recompile with the new header changes. Thank you! |