From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FjJop-0006ls-4r for qemu-devel@nongnu.org; Thu, 25 May 2006 13:40:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FjJon-0006lT-Tr for qemu-devel@nongnu.org; Thu, 25 May 2006 13:40:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FjJon-0006lK-RN for qemu-devel@nongnu.org; Thu, 25 May 2006 13:40:17 -0400 Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FjJtU-0007MY-O8 for qemu-devel@nongnu.org; Thu, 25 May 2006 13:45:10 -0400 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1FjJoY-00059G-Dy for qemu-devel@nongnu.org; Thu, 25 May 2006 19:40:02 +0200 Received: from cpc1-cmbg8-0-0-cust816.cmbg.cable.ntl.com ([82.6.107.49]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 May 2006 19:40:02 +0200 Received: from aspirin by cpc1-cmbg8-0-0-cust816.cmbg.cable.ntl.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 25 May 2006 19:40:02 +0200 From: "Adam D. Moss" Message-ID: References: <20060525110137.GB17024@MAIL.13thfloor.at> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: <20060525110137.GB17024@MAIL.13thfloor.at> Sender: news Subject: [Qemu-devel] Re: sdl fix for mouse grab/hide Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Thu, 25 May 2006 17:40:19 -0000 To: qemu-devel@nongnu.org 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 anthony@codemonkey.ws --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.