Fix crash in screenX and screenY getters returning negative values (#35235)

Instead of casting the window client rect to `u32`, keep it as `i32` and just cast the size dimensions to `u32`.

Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
webbeef 2025-01-31 00:17:39 -08:00 committed by GitHub
parent ad07db0b0c
commit 42b581a6f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1849,10 +1849,10 @@ impl Window {
.compositor_api
.sender()
.send(webrender_traits::CrossProcessCompositorMessage::GetClientWindowRect(send));
let rect = recv.recv().unwrap_or_default().to_u32();
let rect = recv.recv().unwrap_or_default();
(
Size2D::new(rect.size().width, rect.size().height),
Point2D::new(rect.min.x as i32, rect.min.y as i32),
Size2D::new(rect.size().width as u32, rect.size().height as u32),
Point2D::new(rect.min.x, rect.min.y),
)
}