mirror of
https://github.com/servo/servo.git
synced 2025-09-19 11:20:09 +01:00
servoshell: Do not send mouse button events to Servo that happen outside the WebView
(#38696)
`webview_relative_mouse_point` can have negative y-coordinate when at toolbar, but we still would notify compositor the native mousebutton event to do hit-test. Testing: This fixes the way that mouse events are passed from servoshell to Servo, but there is currently no way to test those kind of interactions. Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
02dca0fb21
commit
aca4bde93d
1 changed files with 4 additions and 0 deletions
|
@ -287,6 +287,10 @@ impl Window {
|
|||
};
|
||||
|
||||
let point = self.webview_relative_mouse_point.get();
|
||||
// `point` can be outside viewport, such as at toolbar with negative y-coordinate.
|
||||
if !webview.rect().contains(point) {
|
||||
return;
|
||||
}
|
||||
let action = match action {
|
||||
ElementState::Pressed => MouseButtonAction::Down,
|
||||
ElementState::Released => MouseButtonAction::Up,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue