1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

LibWeb: Repaint the page immediately when using the mouse to select

Otherwise we'd repaint the next time our "caret blink" timer would fire
(or something else caused a repaint). This made selection feel sluggish.
This commit is contained in:
Andreas Kling 2022-09-16 00:34:43 +02:00
parent 11a44ffb69
commit 54e7359243

View file

@ -466,6 +466,7 @@ bool EventHandler::handle_mousemove(Gfx::IntPoint const& position, unsigned butt
if (start_index.has_value() && hit.has_value() && hit->dom_node()) {
m_browsing_context.set_cursor_position(DOM::Position(*hit->dom_node(), *start_index));
layout_root()->set_selection_end({ hit->paintable->layout_node(), hit->index_in_node });
m_browsing_context.set_needs_display();
}
if (auto* page = m_browsing_context.page())
page->client().page_did_change_selection();