On Fri, 27 Mar 2026 21:25:32 GMT, Alexey Ivanov <[email protected]> wrote:

> I'll test the fix on a touch-screen device.

**It doesn't work.**

I couldn't test the update code with mouse event logging, but I suspect the 
problem is that *double-click is still not generated*.

The [reference 
documentation](https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-touchinput)
 says the following:

> Note that a solitary touch point or, in a set of simultaneous touch points, 
> the first to be detected, is designated the primary. The system mouse 
> position follows the primary touch point and, in addition to touch messages, 
> also generates `WM_LBUTTONDOWN`, `WM_MOUSEMOVE`, and `WM_LBUTTONUP` messages 
> in response to actions on a primary touch point. The primary touch point can 
> also generate `WM_RBUTTONDOWN` and `WM_RBUTTONUP` messages using the press 
> and hold gesture.

Now, we skip sending `WM_MOUSEMOVE`, but it doesn't change the fact that 
`WM_LBUTTONUP` has different coordinates from `WM_LBUTTONDOWN`—therefore no 
click may be sent. With double-tap, the second `WM_LBUTTONDOWN` could have 
slightly different coordinates than the first one…

Thus, the logic should keep track of several `WM_LBUTTONDOWN` + `WM_LBUTTONUP` 
events and coalesce them into double-click, that is increment `clickCount` even 
though the coordinates difference is greater than that for mouse events.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/30450#issuecomment-4157597617

Reply via email to