Skip to content

Commit f90271f

Browse files
committed
WPF - Improve Mouse Click Count
Chromium only supports values of 1,2,3 for clickCount so we set click count to 1 if greater than 3 Resolves #3940
1 parent d833c5e commit f90271f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

CefSharp.Wpf/ChromiumWebBrowser.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,17 @@ private void OnMouseButton(MouseButtonEventArgs e)
23282328
}
23292329
else
23302330
{
2331-
browser.GetHost().SendMouseClickEvent((int)point.X, (int)point.Y, (MouseButtonType)e.ChangedButton, mouseUp, e.ClickCount, modifiers);
2331+
//Chromium only supports values of 1, 2 or 3.
2332+
//https://github.com/cefsharp/CefSharp/issues/3940
2333+
//Anything greater than 3 then we send click count of 1
2334+
var clickCount = e.ClickCount;
2335+
2336+
if(clickCount > 3)
2337+
{
2338+
clickCount = 1;
2339+
}
2340+
2341+
browser.GetHost().SendMouseClickEvent((int)point.X, (int)point.Y, (MouseButtonType)e.ChangedButton, mouseUp, clickCount, modifiers);
23322342
}
23332343

23342344
e.Handled = true;

0 commit comments

Comments
 (0)