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

Ignoring MouseMoveEx errors and fall back to passed point. #883

Closed
wants to merge 1 commit into from

Conversation

ChristophHornung
Copy link

GetMouseMovePointsEx can return e.g. an "access denied" error, in this case it is sensible to return to fall back to the old mouse move handling.
Fixes issues like #820

Purpose of this PR

Description: GetMouseMovePointsEx was introduced in 095d3f2 and added Win32Exceptions that were thrown on all errors except "ERROR_POINT_NOT_FOUND". Other errors can be returned from GetMouseMovePointsEx such as "Access denied" (see: #820)
Affects: WinGl

Testing status

A custom version of OpenTK with the error ignored and previous point handling being used was installed for affected users, the error did not occur again over the span of a few weeks. Rolling back to the base version did reintroduce the error.

Comments

I am still uncertain about the root cause of the error. Microsoft's documentation does not mention why the error would be returned and since the error was not reproducible on most machines (including all of mine) it was hard to guess a root cause. Some users did mention this occurred mostly after leaving the program idle for a few minutes, some reported it to occur after awaking the computer from a screensaver state. The users that did see the error had mostly older hardware.

Since GetMouseMovePointsEx is only used for smoothing out mouse movements I feel it is acceptable to ignore this error, the only thing "going wrong" in this case is the missing smooth, which already is done in case of the ERROR_POINT_NOT_FOUND error.

MouseMoveEx can return e.g. an "access denied" error, in this case it is sensible to return to fall back to the old mouse move handling.
Fixes issues like opentk#820
@Perksey
Copy link
Contributor

Perksey commented Feb 9, 2019

Hi Christoph, thanks so much for wanting to contribute to OpenTK! It's people like you that keep the project going.

Unfortunately, this PR isn't feasible with the direction we're taking OpenTK in 4.0, as we're completely removing the native platforms. That means that we're deleting the code for Win32, SDL, and X11 altogether.

If you want to learn more about 4.0, I advise looking at #867 #805 #823 or join our Discord server!

@Perksey Perksey closed this Feb 9, 2019
@ChristophHornung
Copy link
Author

Hi Dylan,

thank you for your quick reply. Should I change the pull request to base on the 3.0 branch, or will there be no more bugfix releases for the 3.0 line?

Regards
Christoph

@Perksey
Copy link
Contributor

Perksey commented Feb 9, 2019

Unfortunately, we've frozen the 3.0 branch to focus all our efforts to 4.0, so PRs to that branch will be rejected. It will help us concentrate on 4.0 though - the biggest update since 2006 - so there is good reason behind this decision.

@ChristophHornung
Copy link
Author

Ok, I was just trying to push the fix upstream in case other people run into it. I am looking forward to migrating to 4.0, good luck with the new version.

@Perksey
Copy link
Contributor

Perksey commented Feb 9, 2019

Thanks! We look forward to get it in your hands :)

@Perksey Perksey reopened this May 25, 2019
@Perksey
Copy link
Contributor

Perksey commented May 25, 2019

@varon Candidate for the 3.0 final release. Have a look over it if you find yourself with nothing to do?

@Perksey Perksey changed the base branch from master to 3.0 May 25, 2019 18:03
@Perksey Perksey changed the base branch from 3.0 to master May 25, 2019 18:03
@Perksey
Copy link
Contributor

Perksey commented May 25, 2019

Changes will need to be rebased onto 3.0 as this currently targets 4.0

leezer3 added a commit to leezer3/OpenBVE that referenced this pull request Jun 10, 2019
opentk/opentk#914
opentk/opentk#883

Primarily bumping for these two, SharpcCompress contains various non-critical fixes.
@varon
Copy link
Member

varon commented Jun 15, 2019

@leezer3 - About to do re-do this PR, but figure it's a good enough place to contact you as I don't see you on the Discord. Anything fixes or minor stuff you'd like to get in for the next 3.x update?

@leezer3
Copy link
Contributor

leezer3 commented Jun 15, 2019

Nothing I know about a fix for.

IIRC there's a (minor) problem somewhere with the SDL2 backend on Linux when in windowed mode, think it was related to mouse co-ordinates / grabbing when outside the window.
Haven't investigated that though, although I could reproduce, as I basically decided that it was a minor irritant at best.
Will try and find some details later.

@leezer3
Copy link
Contributor

leezer3 commented Jun 15, 2019

We might also want to consider these:
#819

Untested here, & some may have come in through tyronx's PR you've just merged.

@leezer3
Copy link
Contributor

leezer3 commented Jun 15, 2019

Another one from @tyronx which I don't believe has been merged:
#758
anegostudios@322c1fe

Do we want a tracker issue with the outstanding stuff for 3.1 on?
I can merge / PR in the stuff from the linked issue if necessary, but I haven't really got tests or personal experience for any of these bits, it's rather stuff which other peeps have proposed post the 4.0 process starting.

n.b. Not on Discord or most other social media, chat etc, sorry :P

@tyronx
Copy link
Contributor

tyronx commented Jun 15, 2019

oh, no, #758 is already merged as part of my cumulative PR accepted by @varon

[Edit:] Or not? :o
Need to look through my changes. Will add another comment when I'm done with that

@leezer3
Copy link
Contributor

leezer3 commented Jun 15, 2019

Didn't seem to have been, although I only skimmed the diff :)

@leezer3
Copy link
Contributor

leezer3 commented Jun 15, 2019

Another one which is potentially implementable for very little work:
#754

The code in the first post of the issue looks highly sensible to me.

@varon
Copy link
Member

varon commented Jun 16, 2019

Thanks @leezer3 . You're a hero for helping here. Appreciate it too @tyronx .

Development is super active on Discord. We'd love to have you come join us if you're not there already.

@leezer3 leezer3 mentioned this pull request Jun 19, 2019
@tyronx
Copy link
Contributor

tyronx commented Jun 19, 2019

@ChristophHornung
Copy link
Author

Is there anything I can do here to help with my original pull request?

@leezer3
Copy link
Contributor

leezer3 commented Jun 19, 2019

You should be fine- I've included it in #935

Should hopefully be merged into 3.0 soon.
4.0 shouldn't need it :)

@varon
Copy link
Member

varon commented Jun 21, 2019

Thanks so much @ChristophHornung and @leezer3. Hugely appreciated this.

Closing this PR, as this fix was introduced in #935 .

Please do come join our very active community on Discord!

@varon varon closed this Jun 21, 2019
@frederikja163 frederikja163 changed the title [WIP] Ignoring MouseMoveEx errors and fall back to passed point. Ignoring MouseMoveEx errors and fall back to passed point. Feb 27, 2020
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

Successfully merging this pull request may close these issues.

None yet

5 participants