|
From: | Adam D. Moss |
Subject: | [Qemu-devel] Re: sdl fix for mouse grab/hide |
Date: | Thu, 25 May 2006 17:40:19 -0000 |
User-agent: | Thunderbird 1.5 (X11/20051201) |
Herbert Poetzl wrote:
which is almost met, except for qemu _not_ using the SDL_ShowCursor() but instead doing a special SDL_SetCursor(sdl_cursor_hidden), which results in SDL _not_ transmitting the relative motion events once the border is reached, which in turn gives funny behaviour :)
The code you're changing was added to work-around a supposed SDL bug in the first place. Below is the text of the original 2006-03-01 posting for the change, by address@hidden --adam ------------------------------------------------------There appears to bug a bug in the latest version of SDL (1.2.9) that causes the position of the cursor to be wrongly reported after calling SDL_ShowCursor(0).
When the cursor is disabled, relative and absolute mouse events are reported as garbage.
This patch works around this by using a invisible cursor instead of disabling the cursor. This has the same functionality of disabling the cursor but avoids these problems.
For what it's worth, disabling the cursor in older versions of SDL also has strange side effects. For instance, the cursor gets warped when you hit the edge of the bounding box. If you're using an absolute input device (emulating a Wacom or Synaptics touchpad for instance), this results in weird mouse behavior (when you exit this window, your mouse ends up in the middle of the window!).
Avoiding SDL_ShowCursor(0) is probably a good idea regardless of this particular bug.
[Prev in Thread] | Current Thread | [Next in Thread] |