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 2496

Summary: mouse left button double click event issue
Product: SDL Reporter: cplu <chenpinglu01>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: chenpinglu01
Version: 2.0.3   
Hardware: x86_64   
OS: Windows 8   

Description cplu 2014-04-14 07:30:55 UTC
When I double click on a window, the "clicks" field (newly added since 2.0.2) in SDL_MouseButtonEvent is 1 instead of 2.
However, when I "tripple" click, "clicks" field is then 2.
I'v look into the source code in SDL_windowsevents.c and found that when a double click event comes, WIN_WindowProc will get a WM_LBUTTONDBLCLK msg. The message sequence of a double click is:WM_LBUTTONDOWN->WM_LBUTTONUP->WM_LBUTTONDBLCLK->WM_LBUTTONUP.
It seems that WIN_WindowProc has not dealt with the sequence above correctly and no "left button down" for the second click, which causes the problem I mentioned.
Comment 1 Sam Lantinga 2014-04-18 03:58:42 UTC
According to Microsoft's documentation, WM_LBUTTONDBLCLK will only be sent to windows with the CS_DBLCLKS style. Are you setting that on the SDL window?
Comment 2 cplu 2014-04-18 04:56:13 UTC
I'm using wxPanel and maybe it has set CS_DBCLICKS as default. I'll take a close look at its source.
Comment 3 Sam Lantinga 2014-04-18 05:50:55 UTC
This should be fixed, thanks!
https://hg.libsdl.org/SDL/rev/e3a80970cf0b