Skip to content

Commit

Permalink
Mark mouse button down/up as handled should resolve #1002
Browse files Browse the repository at this point in the history
Move calculating of position and modifiers into the null check, those vars are only relevant when there is a browser host
  • Loading branch information
amaitland committed Aug 8, 2016
1 parent eafbdd9 commit 05b4e05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CefSharp.Wpf/ChromiumWebBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1867,13 +1867,15 @@ private void OnMouseButton(MouseButtonEventArgs e)
return;
}

var modifiers = e.GetModifiers();
var mouseUp = (e.ButtonState == MouseButtonState.Released);
var point = e.GetPosition(this);

if (browser != null)
{
var modifiers = e.GetModifiers();
var mouseUp = (e.ButtonState == MouseButtonState.Released);
var point = e.GetPosition(this);

browser.GetHost().SendMouseClickEvent((int)point.X, (int)point.Y, (MouseButtonType)e.ChangedButton, mouseUp, e.ClickCount, modifiers);

e.Handled = true;
}
}

Expand Down

0 comments on commit 05b4e05

Please sign in to comment.