diff --git a/Libraries/LibWeb/Page/EventHandler.cpp b/Libraries/LibWeb/Page/EventHandler.cpp index 6a6c4d7a8ec..913968c0e58 100644 --- a/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Libraries/LibWeb/Page/EventHandler.cpp @@ -619,7 +619,10 @@ EventResult EventHandler::handle_mousemove(CSSPixelPoint viewport_position, CSSP auto& page = m_navigable->page(); - page.client().page_did_request_cursor_change(hovered_node_cursor); + if (page.current_cursor() != hovered_node_cursor) { + page.set_current_cursor(hovered_node_cursor); + page.client().page_did_request_cursor_change(hovered_node_cursor); + } if (hovered_node_changed) { GC::Ptr hovered_html_element = document.hovered_node() ? document.hovered_node()->enclosing_html_element_with_attribute(HTML::AttributeNames::title) : nullptr; diff --git a/Libraries/LibWeb/Page/Page.h b/Libraries/LibWeb/Page/Page.h index 5892ec90981..3200c763da9 100644 --- a/Libraries/LibWeb/Page/Page.h +++ b/Libraries/LibWeb/Page/Page.h @@ -121,6 +121,9 @@ public: bool is_webdriver_active() const { return m_is_webdriver_active; } void set_is_webdriver_active(bool b) { m_is_webdriver_active = b; } + Gfx::StandardCursor current_cursor() const { return m_current_cursor; } + void set_current_cursor(Gfx::StandardCursor cursor) { m_current_cursor = cursor; } + DevicePixelPoint window_position() const { return m_window_position; } void set_window_position(DevicePixelPoint position) { m_window_position = position; } @@ -246,6 +249,8 @@ private: // The webdriver-active flag is set to true when the user agent is under remote control. It is initially false. bool m_is_webdriver_active { false }; + Gfx::StandardCursor m_current_cursor { Gfx::StandardCursor::Arrow }; + DevicePixelPoint m_window_position {}; DevicePixelSize m_window_size {}; GC::Ptr> m_window_rect_observer;