| Summary: | Work around cocoa relative mouse jump on first event | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Kevin Shanahan <kmshanah> |
| Component: | video | Assignee: | (disabled) Jørgen Tjernø <jorgen> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | Keywords: | target-2.0.0 |
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | Mac OS X (All) | ||
| See Also: | https://bugzilla.libsdl.org/show_bug.cgi?id=2867 | ||
| Attachments: |
Simple workaround for cocoa relative mouse jump
Test case to reproduce |
||
I noticed some recent activity in this area in hg, but just wanted to confirm that I still get a big relative mouse event the first time the mouse is touched after setting relative mode as of hg changeset: 7152:e9ed46195235 This should be fixed at this point - I am unable to reproduce it. Test after http://hg.libsdl.org/SDL/rev/963d2ba35cfe and reopen this issue if it's still a problem. Still able to reproduce here with hg version 7279:f7805b13b485. I'll try and write a simple test case for you. Okay, that was actually educational. I couldn't reproduce with simply setting relative mouse mode, but have discovered the problem lies with setting a mouse grab. When the mouse is grabbed, mouse motion is queued up but the event is not generated until the next time the mouse is moved. This only seems to affect OSX - Windows and Linux don't have the same issue. Created attachment 1175 [details]
Test case to reproduce
I also note that the cursor doesn't un-hide properly if you quit while the mouse is grabbed. Should that be a separate bug? (Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.) Tagging a bunch of bugs as target-2.0.0, Priority 2. This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible. That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship. Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment. Thanks! --ryan. Kevin, are you still seeing the issue with the cursor not unhiding? That's not reproducing here, but I did fix some cursor hiding issues previously. And other than the "jump", does the grabbed mode behave like it does on Windows and Linux? I still see some problems, but definitely not every time (which is a bit frustrating!) Most of the time the problem is reproducible with these steps: * run ./test-relative-mouse * hit space to grab the mouse * hit q to quit the app You may need to run the test several times to reproduce the problem. I haven't been able to spot any pattern to the failures as yet. To answer the other question - yes, apart from the jump on first movement of the mouse, the grabbed mode appears to work the same on OS X as it does Windows and Linux. I should have mentioned, SDL framework compiled from tip 7497:109f37bca7cc for my comments 10 and 11. (In reply to Kevin Shanahan from comment #12) > I should have mentioned, SDL framework compiled from tip 7497:109f37bca7cc > for my comments 10 and 11. Sorry for not looking at this again sooner, but it should be fixed in the upcoming 2.0.2. Would you be able to test the fix that I committed here? https://hg.libsdl.org/SDL/rev/841b66e4397a (In reply to Jørgen Tjernø from comment #13) > Sorry for not looking at this again sooner, but it should be fixed in the > upcoming 2.0.2. Would you be able to test the fix that I committed here? > https://hg.libsdl.org/SDL/rev/841b66e4397a Fix works well - no more jumps! Thanks :) Cheers, Kevin. Marking as FIXED with https://hg.libsdl.org/SDL/rev/841b66e4397a |
Created attachment 1128 [details] Simple workaround for cocoa relative mouse jump Sent this to the mailing list a while ago: After setting relative mouse mode on OS X, the first time the mouse is moved a big delta is given (I guess some delta from the mouse position at the time to the fixed point it then reports delta from). In my case, an FPS with mouse controlling the view angle, this means the view jumps to some crazy orientation the first time you touch the mouse. I tried working around it in various ways, but the only solution I found that worked was to simply ignore the first event the comes in after setting relative mouse mode. Does the attached seem like a reasonable workaround?