|
@@ -270,10 +270,15 @@ bool EventHandler::handle_mouseup(CSSPixelPoint position, CSSPixelPoint screen_p
|
|
|
|
|
|
bool run_activation_behavior = false;
|
|
|
if (node.ptr() == m_mousedown_target) {
|
|
|
- if (button == GUI::MouseButton::Primary)
|
|
|
+ if (button == GUI::MouseButton::Primary) {
|
|
|
run_activation_behavior = node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(node->realm(), UIEvents::EventNames::click, screen_position, page_offset, client_offset, offset, {}, 1, button, modifiers).release_value_but_fixme_should_propagate_errors());
|
|
|
- else if (button == GUI::MouseButton::Secondary && !(modifiers & Mod_Shift)) // Allow the user to bypass custom context menus by holding shift, like Firefox.
|
|
|
- run_activation_behavior = node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(node->realm(), UIEvents::EventNames::contextmenu, screen_position, page_offset, client_offset, offset, {}, 1, button, modifiers).release_value_but_fixme_should_propagate_errors());
|
|
|
+ } else if (button == GUI::MouseButton::Secondary) {
|
|
|
+ // Allow the user to bypass custom context menus by holding shift, like Firefox.
|
|
|
+ if ((modifiers & Mod_Shift) == 0)
|
|
|
+ run_activation_behavior = node->dispatch_event(UIEvents::MouseEvent::create_from_platform_event(node->realm(), UIEvents::EventNames::contextmenu, screen_position, page_offset, client_offset, offset, {}, 1, button, modifiers).release_value_but_fixme_should_propagate_errors());
|
|
|
+ else
|
|
|
+ run_activation_behavior = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (run_activation_behavior) {
|