-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Win32: Buffered approach to raw mouse motion, PR fix for #2684 #2750
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
base: master
Are you sure you want to change the base?
Conversation
|
It looks like the MinGW builds fail because #ifndef RI_MOUSE_HWHEEL
// MinGW may not have the define for RI_MOUSE_HWHEEL
#define RI_MOUSE_HWHEEL 0x0800
#endif |
ask and ye shall find! |
| MSG msg; | ||
| HWND handle; | ||
| _GLFWwindow* window; | ||
| _GLFWwindow* window = _glfw.windowListHead; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line does nothing, and should be reverted to:
_GLFWwindow* window;|
I've done an initial testing of the code, along with a brief review (one note added above). Given this affects all raw mouse input I'd like a bit more time testing and checking the code. Meanwhile do take a look at the guide on contributing a bug fix and feature. This is somewhat more like a bug fix as the optimization does not add new functionality, simply improves an existing one. https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md#contributing-a-bug-fix So in addition to the code we need:
I can do these if you don't have the time. You can search previous commits for examples. |
|
@Pannoniae Could you remove your tag GLFW "3.5.0"? Sadly due to an error I made (see #2758) the tag got added to GLFW until I found out and deleted it. In order to reduce any confusion could you delete the tag (but keep the source code branch)? |
|
yeah, I will do it in an hour or two (sorry about that, I've been busy the past week!) |
|
Do you have time to update the PR with changes related to the comments I've made, in particular the bug I mention in the first review comment? If not I can look into making the required changes myself when merging. |
|
sadly no, some things have come up... |
|
OK - then if I get time I'll look into making the required changes. |
|
much appreciated! |
|
Thanks for working on this! I tested this PR and found that when pressing three mouse buttons simultaneously (e.g., left, right, and a side button) and releasing them at the same time, there is a high probability that some buttons will remain stuck in the pressed state. (This issue only occurs when Let me know if you need any more details on the reproduction steps. |
|
Thanks @IzumiiKonata that's a great bug report - I can indeed now see in the code that though a set of flags for each button pressed/released is processed, it's done assuming only one key event happens at a time. I can see how to alter this to fix the issue but won't have time for a bit. |
|
I have pushed several fixes and updates to a branch on my fork: https://github.com/dougbinks/glfw/tree/pr-2750-win32-buf-raw-m This should fix the issue @IzumiiKonata raised along with the multi-window bug I mentioned and most of the review comments I made. The one remaining issue is bounding the raw buffer memory allocation to something sensible, and add a loop to cope with larger input buffers. |
|
I've now added a bounded raw input buffer with looping read, plus fixed a potential crash after an error. I think the PR is now functionally complete (if testing shows no further issues), but needs some other changes as per the contributing guide except documentation since this feature does not change the API:
|
|
I have updated both the I've done quite a bit of testing, but if @Pannoniae and @IzumiiKonata could test my branch below that would be very helpful: |
|
Just my name as it is on GitHub is fine, thank you! I'll try to see whether any more bugs come up. |
|
@Pannoniae I've updated the contributors. If you want to merge my branch into yours then I can merge the PR from the Github UI but that's not required. |
|
I don't know how to merge it in :\ |
|
No problem, I'll merge the PR from my branch keeping your authorship! |
Fixes #2684, now without all the commented out debug code. Hope it doesn't break anything.