| Summary: | relative movements of the mouse not working correctly. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Johnny Birnfeld <johnny.birnfeld> |
| Component: | events | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | anpaza, icculus |
| Version: | 1.2.10 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
|
Description
Johnny Birnfeld
2006-08-09 16:30:42 UTC
*** Bug 348 has been marked as a duplicate of this bug. *** I can confirm this in http://tremulous.net (ioquake3) under linux with libsdl 1.2.10 make the game windowed, then open some other window (for example terminal or firefox) and then switch back to tremulous and go fullscreen again = the mouse will think it is still in previous application window(!?!) :( = the mouse will have horizontal and vertical boundaries set = you wont be able to spin/turn freely also playing Deus Ex under wine exhibits this error + some weird shit Deus Ex has a splash screen, normally that splash screen dissapears after a second and we are in the game, but sometimes when switching between windowed/fullscreen splash screen appears with mouse grabbed inside it, and the game in the background, game receives mouse events only when you move the mouse to the splash screen borders, but mouse cant escape the splash screen. Anyway it works ok in 1.2.9, and is broken in 1.2.10 This is X11-specific. We're failing to enable DGA mouse events when grabbing the input if the system cursor is outside the window...and the normal X11 mouse event isn't warping the grabbed+hidden cursor to the center of the window (like it used to?), so relative motion gets clamps to the window's edges. svn revision #2236 broke the DGA code: http://libsdl.org/cgi/viewvc.cgi/trunk/SDL/src/video/x11/SDL_x11mouse.c?r1=2236&r2=2235&pathrev=2236 It's checking for a focus flag that isn't true if the input is grabbed when the cursor is outside the window (SDL_APPMOUSEFOCUS). My fix is to report to SDL that the mouse focus has been obtained when SDL_WM_GrabInput(SDL_GRAB_ON) is successfully called, since it happens to be true, due to the XGrabPointer() ... if the X server then tries to report on the real obtaining of the mouse focus, that's okay, SDL won't send the duplicate event to the app. This allows DGA to enable, as before. Not sure why the warp-the-mouse-to-center hack for non-DGA modes isn't working, though. Fixed in svn revision #2909. --ryan. |