mirror of
https://github.com/servo/servo.git
synced 2025-08-21 21:35:32 +01:00
[OH] Provide correct geometry offset and fix available screen dimensions (#36915)
This commit corrects the geometry details provided under the OH platform by getting the offset from the OS. OH port provides correct offset and available space. Fixes: #36466 --------- Signed-off-by: Astraea Quinn Skoutelli <astraea.quinn.skoutelli@huawei.com> Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
This commit is contained in:
parent
2aaf9695df
commit
366515f256
3 changed files with 47 additions and 6 deletions
|
@ -97,7 +97,10 @@ pub fn init(
|
|||
let Ok(window_size) = (unsafe { super::get_xcomponent_size(xcomponent, native_window) }) else {
|
||||
return Err("Failed to get xcomponent size");
|
||||
};
|
||||
let coordinates = Coordinates::new(0, 0, window_size.width, window_size.height);
|
||||
let Ok((x, y)) = (unsafe { super::get_xcomponent_offset(xcomponent, native_window) }) else {
|
||||
return Err("Failed to get xcomponent offset");
|
||||
};
|
||||
let coordinates = Coordinates::new(x, y, window_size.width, window_size.height);
|
||||
|
||||
let display_handle = RawDisplayHandle::Ohos(OhosDisplayHandle::new());
|
||||
let display_handle = unsafe { DisplayHandle::borrow_raw(display_handle) };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue