We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1081 - Missing mouse down events in a particular input grab+show cursor scenario
Summary: Missing mouse down events in a particular input grab+show cursor scenario
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.14
Hardware: Other Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-26 06:30 UTC by Jānis Rūcis
Modified: 2011-04-13 21:46 UTC (History)
1 user (show)

See Also:


Attachments
Small test program (1.86 KB, text/x-c)
2010-11-26 06:30 UTC, Jānis Rūcis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jānis Rūcis 2010-11-26 06:30:17 UTC
Created attachment 547 [details]
Small test program

I had a bug reported against Neverball from some users, saying that in certain situations just after a screen transition the first mouse click does not register, although following clicks do succeed.  I could not reproduce it following their instructions on my own system (Debian Lenny), but managed to do so on a virtual install of Ubuntu 10.10.

Here's the original report (FWIW, the code in question has not changed since at least 2004, so any Neverball version is good for testing if you feel like it):

http://forum.nevercorner.net/viewtopic.php?id=2217

Attached is a little test app to demonstrate the problem.  To reproduce it, I used the following set of actions (with mouse clicks interspersed for verbosity):

click
g (grab)
h (hide cursor on next mouse click)
click (hides cursor)
click
h (shows pointer immediately)
click
g (ungrab)

First, here is the (expected) output of the app obtained on Debian Lenny (X.Org 7.3, server 1.4.2):

 press
 release
grab
hide cursor on next mouse down
 press
hide cursor
 release
 press
 release
show cursor
 press
 release
ungrab

The same set of actions on Ubuntu 10.10 (X.Org 7.5, server 1.9.0):

 press
 release
grab
hide cursor on next mouse down
 press
hide cursor
 release
 press
 release
show cursor
 release
ungrab

The mouse down event for the last mouse click is missing.

It seems that what triggers the problem the cursor being hidden between a mouse down and mouse up event (but only when input has already been grabbed earlier or is being grabbed on the same occasion).

The problem also does not occur if SDL_VIDEO_X11_DGAMOUSE is set to 0.
Comment 1 Jānis Rūcis 2010-11-26 09:11:24 UTC
Something I forgot to mention...

I didn't speak much of the SDL versions involved.  That's because the two SDL versions I tested (1.2.14 and 1.2.13) were both fine on the Debian system, and were both broken on Ubuntu.  So I think the cause lies somewhere in the X.Org server, probably some change that violates assumptions made by SDL.
Comment 2 Jen Spradlin 2011-04-12 20:07:57 UTC
Thank you for your bug report!

We're busy working on getting SDL 1.3 ready for a high quality release, and want to make sure as many things are fixed there as possible.
Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot?
http://www.libsdl.org/tmp/SDL-1.3.zip

Thanks!
Comment 3 Jānis Rūcis 2011-04-13 15:02:08 UTC
Hi,

(In reply to comment #2)
> Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot?
> http://www.libsdl.org/tmp/SDL-1.3.zip

I couldn't test with Neverball itself, but my test case definitely does not exhibit the problem with this version.
Comment 4 Sam Lantinga 2011-04-13 21:46:48 UTC
This appears to be fixed in SDL 1.3.

Thanks!