1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:37:34 +00:00

Ladybird+LibWeb: Add MouseEvent screenX and screenY support

This commit is contained in:
Bastiaan van der Plaat 2023-09-08 18:48:44 +02:00 committed by Alexander Kalenik
parent e584189b8f
commit 836a7b00dd
19 changed files with 125 additions and 103 deletions

View file

@ -39,9 +39,10 @@ static KeyModifier ns_modifiers_to_key_modifiers(NSEventModifierFlags modifier_f
MouseEvent ns_event_to_mouse_event(NSEvent* event, NSView* view, GUI::MouseButton button)
{
auto position = [view convertPoint:event.locationInWindow fromView:nil];
auto screen_position = [NSEvent mouseLocation];
auto modifiers = ns_modifiers_to_key_modifiers(event.modifierFlags, button);
return { ns_point_to_gfx_point(position), button, modifiers };
return { ns_point_to_gfx_point(position), ns_point_to_gfx_point(screen_position), button, modifiers };
}
NSEvent* create_context_menu_mouse_event(NSView* view, Gfx::IntPoint position)