Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around cocoa relative mouse jump on first event #856

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

Work around cocoa relative mouse jump on first event #856

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

SDLBugzilla commented Feb 10, 2021

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: HG 2.0
Reported for operating system, platform: Mac OS X (All), All

Comments on the original bug report:

On 2013-05-03 01:07:34 +0000, Kevin Shanahan wrote:

Created attachment 1128
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?

On 2013-05-06 00:28:39 +0000, Kevin Shanahan wrote:

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

On 2013-06-04 18:09:25 +0000, (disabled) Jørgen Tjernø wrote:

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.

On 2013-06-05 19:40:16 +0000, Kevin Shanahan wrote:

Still able to reproduce here with hg version 7279:f7805b13b485.

I'll try and write a simple test case for you.

On 2013-06-05 20:13:26 +0000, Kevin Shanahan wrote:

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.

On 2013-06-05 20:14:25 +0000, Kevin Shanahan wrote:

Created attachment 1175
Test case to reproduce

On 2013-06-05 20:16:15 +0000, Kevin Shanahan wrote:

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?

On 2013-07-12 22:15:47 +0000, Ryan C. Gordon wrote:

(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.

On 2013-07-16 04:18:01 +0000, (disabled) Jørgen Tjernø wrote:

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.

On 2013-07-16 04:18:29 +0000, (disabled) Jørgen Tjernø wrote:

And other than the "jump", does the grabbed mode behave like it does on Windows and Linux?

On 2013-07-21 21:55:27 +0000, Kevin Shanahan wrote:

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.

On 2013-07-21 21:56:57 +0000, Kevin Shanahan wrote:

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.

On 2013-07-21 21:59:11 +0000, Kevin Shanahan wrote:

I should have mentioned, SDL framework compiled from tip 7497:109f37bca7cc for my comments 10 and 11.

On 2014-02-26 19:36:35 +0000, (disabled) Jørgen Tjernø wrote:

(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

On 2014-02-28 00:36:39 +0000, Kevin Shanahan wrote:

(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.

On 2014-02-28 00:37:41 +0000, (disabled) Jørgen Tjernø wrote:

Marking as FIXED with https://hg.libsdl.org/SDL/rev/841b66e4397a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant