lib: fix absolute x,y mouse position

This commit is contained in:
Christian Hergert 2023-02-15 18:02:51 -08:00
parent a57f55e24c
commit d533773cf7

View File

@ -390,8 +390,8 @@ mks_display_legacy_event_cb (MksDisplay *self,
if (graphene_rect_contains_point (&area, &GRAPHENE_POINT_INIT (x, y)))
{
double guest_x = floor (x) / area.size.width * guest_width;
double guest_y = floor (y) / area.size.height * guest_height;
double guest_x = floor (x - area.origin.x) / area.size.width * guest_width;
double guest_y = floor (y - area.origin.y) / area.size.height * guest_height;
if (guest_x < 0 || guest_y < 0 ||
guest_x >= guest_width || guest_y >= guest_height)