| Summary: | [Regression] Cursor movement is slow and erratic when using SDL_SetWindowGrab | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Rémy Tassoux <contact> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sezeroz, sylvain.becker |
| Version: | 2.0.10 | ||
| Hardware: | x86_64 | ||
| OS: | Windows 10 | ||
I retested this with the latest SDL version (2.0.10), and I can confirm that, unfortunately, this bug is still present. This is a regression as it was working fine until the 2.0.9 version. Not sure but maybe this is helped by https://hg.libsdl.org/SDL/rev/9d6107cbcd66 Related to bug 4841 I tried this change, and I can confirm that it doesn't fix this issue. Ok, too bad! You said it's a regression, but maybe double-check with SDL 2.0.9 version. That also could also be an issue while update window10 version ... Then bisect, e.g try intermediates revision between 2.0.9 and 2.0.10 ! As I already said, I tried the 2.0.9 version. It is a regression because this bug is not here in 2.0.8 version and earlier. I just tried it again to be 100% sure, and yes, everything still works fine with the 2.0.8 on my computer with the latest Windows 10 version (1903), while on 2.0.9 and 2.10.0 SDL_SetWindowGrab is still completely unusable. Sorry it wasn't clear for me if it was introduced between 2.0.8 and 2.0.9, or between 2.0.9 and 2.0.10. And I wanted to make sure this wasn't an issue with a Window update, which you confirmed it wasn't from https://hg.libsdl.org/SDL/tags 3 months ago release-2.0.10 11 months ago release-2.0.9 20 months ago release-2.0.8 SetWindowGrab() belongs to files: src/video/windows/SDL_windowswindow.c src/video/windows/SDL_windowsvideo.c I'm not sure which revisions could introduce the issue: https://hg.libsdl.org/SDL/log/6f0ec1079286/src/video/windows/SDL_windowsvideo.c https://hg.libsdl.org/SDL/log/6f0ec1079286/src/video/windows/SDL_windowswindow.c (maybe https://hg.libsdl.org/SDL/rev/de4288fa5b0b ... ) Try intermediates to spot the right one! (all: https://hg.libsdl.org/SDL/shortlog ) No offence, but if I was able to find where it occurs accurately in the revisions, it would then probably be pretty easy for me to fix it and I would have submitted a patch instead of a bug report. If I find the time to locate the source of this bug and fix it, I'll do it, but I cannot make any promises. Finding should be an easy step :) Since, you said you tried with the latest (https://hg.libsdl.org/SDL/rev/9d6107cbcd66), it means you have the source under revision, right ? So that you can move between revisions with not much effort. (ok maybe I'm just wrong and you applied the commit manually, or you just retried with old 2.0.10, and not the current head source ?) So, bisect is just about trying a revision in the middle of the last known working and first not working. and then retrying until you find out the problematic revision. So, if you do it correctly, it's about updating 6 or 7 times, compiling, running your sample program again. I don't use Mercurial and never had. I'm contributing to the sdl2 port on vcpkg (I made the one for the 2.10.0 version) and that's also what I'm using to build it. Anyway, I watched the video attached to the bug you linked, and it appears to be exactly the same problem (the cursor choppiness and OS beeps on mouse move). His bug report should be detailed enough to help fix this bug. So I resolved it as a duplicate. And maybe you didn't actually try this change https://hg.libsdl.org/SDL/rev/9d6107cbcd66 ? If you compile from source (even without using mercurial), you can apply manually this 1 line commit, or you can fetch there is a night build I think... *** This bug has been marked as a duplicate of bug 4748 *** See my third post in this report, I did try it, right after you suggested it, and unfortunately it didn't fix this bug. I applied it manually to the sources before building it with vcpkg. Indeed, thanks! |
Calling SDL_SetWindowGrab with SDL_TRUE on a window makes the cursor movements very slow and jerky, making this functionality unusable. The minimal code to reproduce this bug : #define SDL_MAIN_HANDLED #include <SDL2/SDL.h> int main() { SDL_Init( SDL_INIT_VIDEO | SDL_INIT_EVENTS ); auto sdl2_window = SDL_CreateWindow( "Window", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 800, 600, SDL_WINDOW_RESIZABLE ); SDL_SetWindowGrab( sdl2_window, SDL_TRUE ); bool run{ true }; while ( run ) { SDL_Event event{}; SDL_PollEvent( &event ); if ( event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE ) run = false; } SDL_DestroyWindow( sdl2_window ); return 0; } In the previous SDL release (2.0.8), everything works fine.