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 - mouse left button double click event issue
Summary: mouse left button double click event issue
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.3
Hardware: x86_64 Windows 8
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-14 07:30 UTC by cplu
Modified: 2014-04-18 05:50 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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