| Summary: | grab mouse inconsistent state | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Martin Gerhardy <martin.gerhardy> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus, yv.sharma |
| Version: | HG 2.0 | Keywords: | target-2.0.4 |
| Hardware: | x86_64 | ||
| OS: | Linux | ||
|
Description
Martin Gerhardy
2015-06-15 06:45:04 UTC
Okay, I think this is fixed: https://hg.libsdl.org/SDL/rev/885b6b5c8426 I don't have an environment where I can easily test this, can you verify the fix? Thanks! Still triggered. Assertion failure at SDL_GetGrabbedWindow_REAL (/home/mgerhardy/dev/caveexpress/src/libs/SDL/src/video/SDL_video.c:2180), triggered 1 time: '!_this->grabbed_window || ((_this->grabbed_window->flags & SDL_WINDOW_INPUT_GRABBED) != 0)' reopen - see my previous comment looks like SDL_SetWindowGrab and SDL_UpdateWindowGrab compute different "SDL_bool grabbed" states This one is my bug, taking it. --ryan. Hi Ryan Any fix so far ? Actually, I'm trying to find a way to trigger that assertion and can't. Martin, is this still happening to you? --ryan. hm. I can't reproduce the assert anymore - but for my code the grabbing and ungrabbing doesn't work at all anymore. I always have the mouse grabbed (software renderer - as there might be grabbing issues... e.g. I only receive mouse move event in software render mode after I at least once alt+tabbed away) will try a different renderer to double check. Assertion failure at SDL_GetGrabbedWindow_REAL (/home/mgerhardy/dev/caveexpress/src/libs/sdl2/src/video/SDL_video.c:2283), triggered 1 time:
'!_this->grabbed_window || ((_this->grabbed_window->flags & SDL_WINDOW_INPUT_GRABBED) != 0)'
still happens on latest hg rev.
void SDLFrontend::toggleGrabMouse () {
#if SDL_VERSION_ATLEAST(2, 0, 4)
const bool grabMouse = SDL_GetGrabbedWindow() == _window;
#else
const bool grabMouse = Config.isGrabMouse();
#endif
if (grabMouse) {
SDL_SetWindowGrab(_window, SDL_FALSE);
Log::info(LOG_GFX, "Mouse grab is now deactivated");
Config.setGrabMouse(false);
} else {
SDL_SetWindowGrab(_window, SDL_TRUE);
Log::info(LOG_GFX, "Mouse grab is now activated");
Config.setGrabMouse(true);
}
}
this is the code that I use to trigger it.
|