mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
servoshell: Fix screen_geometry
for headed_window (#37934)
This function is used to compute `screenLeft`, `screenTop`, `screenY`,
`screenX`. Previously, it wrongly computes viewport position instead of
window position, which didn't match
f7c86c4393/components/shared/embedder/lib.rs (L717-L720)
Testing: More webdriver test would pass once #37893 is merged.
Fixes: the position part of #37824.
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
parent
68ec88465e
commit
ec6ac0fced
3 changed files with 3 additions and 26 deletions
|
@ -438,14 +438,13 @@ impl WindowPortsMethods for Window {
|
|||
|
||||
// Offset the WebView origin by the toolbar so that it reflects the actual viewport and
|
||||
// not the window origin.
|
||||
let window_origin = self.winit_window.inner_position().unwrap_or_default();
|
||||
let window_origin = winit_position_to_euclid_point(window_origin).to_f32();
|
||||
let offset = window_origin + toolbar_size;
|
||||
let window_origin = self.winit_window.outer_position().unwrap_or_default();
|
||||
let offset = winit_position_to_euclid_point(window_origin);
|
||||
|
||||
ScreenGeometry {
|
||||
size: screen_size.to_i32(),
|
||||
available_size: available_screen_size.to_i32(),
|
||||
offset: offset.to_i32(),
|
||||
offset,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue