lib: robustness fixes for mouse movement

This commit is contained in:
Christian Hergert 2023-02-15 17:52:40 -08:00
parent 0a7c1ff21c
commit 62f084b0b4

View File

@ -393,6 +393,10 @@ mks_display_legacy_event_cb (MksDisplay *self,
double guest_x = floor (x) / area.size.width * guest_width; double guest_x = floor (x) / area.size.width * guest_width;
double guest_y = floor (y) / area.size.height * guest_height; double guest_y = floor (y) / area.size.height * guest_height;
if (guest_x < 0 || guest_y < 0 ||
guest_x >= guest_width || guest_y >= guest_height)
return GDK_EVENT_PROPAGATE;
mks_mouse_move_to (mouse, mks_mouse_move_to (mouse,
guest_x, guest_x,
guest_y, guest_y,