Skip to content

Commit

Permalink
LibWeb: Send page_did_click_link no matter the modifiers
Browse files Browse the repository at this point in the history
d0e18b8 revived sending the `page_did_click_link` event, but only for
a chrome feature where ctrl is also clicked. For the Help app to work
normally (not just when pressing ctrl), we need this event to be sent
no matter the modifier. The modifiers are sent as part of the event so
chromes can ignore non-control clicks.
  • Loading branch information
MacDue committed Jan 19, 2025
1 parent fc2f877 commit b115ce2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Userland/Libraries/LibWeb/Page/EventHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,7 @@ EventResult EventHandler::handle_mouseup(CSSPixelPoint viewport_position, CSSPix
JS::NonnullGCPtr<DOM::Document> document = *m_navigable->active_document();
auto href = link->href();
auto url = document->parse_url(href);

if (button == UIEvents::MouseButton::Primary && (modifiers & UIEvents::Mod_PlatformCtrl) != 0) {
if (button == UIEvents::MouseButton::Primary) {
m_navigable->page().client().page_did_click_link(url, link->target().to_byte_string(), modifiers);
} else if (button == UIEvents::MouseButton::Middle) {
m_navigable->page().client().page_did_middle_click_link(url, link->target().to_byte_string(), modifiers);
Expand Down

0 comments on commit b115ce2

Please sign in to comment.