From e6c0b4631f12f60779a1e2217e0e818e0a8bf60e Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 26 Apr 2024 10:42:18 +0200 Subject: [PATCH] WebContent: Send tooltip screen location in device coordinate space This makes tooltips pop up in the right location when zoomed in and using the Qt chrome. --- Userland/Services/WebContent/PageClient.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Services/WebContent/PageClient.cpp b/Userland/Services/WebContent/PageClient.cpp index a7fcdc3105b..64b957df7ce 100644 --- a/Userland/Services/WebContent/PageClient.cpp +++ b/Userland/Services/WebContent/PageClient.cpp @@ -325,7 +325,8 @@ void PageClient::page_did_request_scroll_to(Web::CSSPixelPoint scroll_position) void PageClient::page_did_enter_tooltip_area(Web::CSSPixelPoint content_position, ByteString const& title) { - client().async_did_enter_tooltip_area(m_id, { content_position.x().to_int(), content_position.y().to_int() }, title); + auto device_position = page().css_to_device_point(content_position); + client().async_did_enter_tooltip_area(m_id, { device_position.x(), device_position.y() }, title); } void PageClient::page_did_leave_tooltip_area()