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

relative movements of the mouse not working correctly. #202

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

relative movements of the mouse not working correctly. #202

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 1.2.10
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2006-08-09 16:30:42 +0000, Johnny Birnfeld wrote:

We have a bug at SDL_Event in the relative mouse movement since SDL-1.2.10. The bug occurs when the mouse cursor start out of the window area and SDL_ShowCursor( ) is disable and SDL_WM_GrabInput( ) enable and SDL_WarpMouse( ) enable.
A souce that tests this bug can be found here: http://geocities.yahoo.com.br/megaspeedlinux/testSDLEvent.zip
The program will inform mouse position and relative movement. So if you start the pointer out of the window area and start program, try to move the mouse to the edges of the window. You'll notice that the program stops inform the new relative positions.
This source was compiled with:
g++ testeSDL_event.cpp -o testeSDL_event -lSDL

What can be happening?

On 2006-10-23 05:13:17 +0000, Ryan C. Gordon wrote:

*** Bug 348 has been marked as a duplicate of this bug. ***

On 2006-10-23 05:37:01 +0000, rasz wrote:

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

On 2006-10-23 05:42:52 +0000, rasz wrote:

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

On 2006-11-12 23:07:20 +0000, Ryan C. Gordon wrote:

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.

On 2007-03-03 17:45:21 +0000, Ryan C. Gordon wrote:

*** Bug 405 has been marked as a duplicate of this bug. ***

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

No branches or pull requests

1 participant