WPF - OnLostMouseCapture with active scrolling.
- Vorherrschende Sprache
- C#
- Sterne
- 10.3k
- Forks
- 2.9k
- Ø Merge
- 5 T. 22 Std.
- Gemergte PRs (30 T.)
- 4
Beschreibung
- **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 https://github.com/cefsharp/CefSharp/pull/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);
}
```
Beitragsleitfaden
Rechercherichtung
Reproduziere das beschriebene WPF-Szenario: Ziehe die Bildlaufleiste, bewege dich außerhalb des Browser-Steuerelements, wechsle mit Alt+Tab zwischen Anwendungen, lasse die Maustaste los und bewege die Maus erneut. Beginne bei der OnLostMouseCapture-Behandlung in WPF und dem im Issue gezeigten Workaround; abgeschlossen ist die Aufgabe, wenn der Browser die linke Maustaste nach dem Verlust der Mauserfassung nicht mehr als gedrückt behandelt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- desktop
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100