Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF - OnLostMouseCapture with active scrolling. #3268

Open
timaiv opened this issue Oct 29, 2020 · 1 comment
Open

WPF - OnLostMouseCapture with active scrolling. #3268

timaiv opened this issue Oct 29, 2020 · 1 comment

Comments

@timaiv
Copy link

timaiv commented Oct 29, 2020

  • What version of the product are you using?
    v85.3.130

  • What architecture x86 or x64?
    Both

  • On what operating system?
    Win10

  • Are you using WinForms, WPF or OffScreen?
    WPF

  • What steps will reproduce the problem?
    1)Draging the scrollbar with left button pressing
    2)move the cursor out of the browser control
    2)press alt+tab, choose other app.
    3)release left button.
    4)move mouse in browser, browser is thinking that mouse is pressed.

  • Please provide any additional information below.
    As i said in WPF - Capture/Release mouse to allow scrolling outside bounds of browser control #2871 we have problem with OnLostMouseCapture.
    Default wpf implementation does not raise mouse up event after lost mouse capture.

    Worked fast fix(SubClass):

        private bool isLeftMouseDown;
        protected override void OnMouseDown(MouseButtonEventArgs e)
        {
            isLeftMouseDown = e.LeftButton == MouseButtonState.Pressed;
            base.OnMouseDown(e);
        }

        protected override void OnLostMouseCapture(MouseEventArgs e)
        {
            var modifiers = e.GetModifiers();
            var point = e.GetPosition(this);

            if (isLeftMouseDown)
            {
                GetBrowser().GetHost().SendMouseClickEvent((int)point.X, (int)point.Y, MouseButtonType.Left, true, 1, modifiers);
                isLeftMouseDown = false;
            }

            base.OnLostMouseCapture(e);
        }
@amaitland
Copy link
Member

Thank you for the detailed bug report.

Can you please submit a PR with your proposed changes. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants