mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
LibWeb: Flush any pending layout updates before processing mouse events
We want to make sure the layout and paint trees are up-to-date before handling any mouse events.
This commit is contained in:
parent
0e8b538e0a
commit
910fded482
1 changed files with 12 additions and 0 deletions
|
@ -129,6 +129,9 @@ Painting::PaintableBox const* EventHandler::paint_root() const
|
|||
|
||||
bool EventHandler::handle_mousewheel(const Gfx::IntPoint& position, unsigned int buttons, unsigned int modifiers, int wheel_delta_x, int wheel_delta_y)
|
||||
{
|
||||
if (m_browsing_context.active_document())
|
||||
m_browsing_context.active_document()->update_layout();
|
||||
|
||||
if (!paint_root())
|
||||
return false;
|
||||
|
||||
|
@ -151,6 +154,9 @@ bool EventHandler::handle_mousewheel(const Gfx::IntPoint& position, unsigned int
|
|||
|
||||
bool EventHandler::handle_mouseup(const Gfx::IntPoint& position, unsigned button, unsigned modifiers)
|
||||
{
|
||||
if (m_browsing_context.active_document())
|
||||
m_browsing_context.active_document()->update_layout();
|
||||
|
||||
if (!paint_root())
|
||||
return false;
|
||||
|
||||
|
@ -203,6 +209,9 @@ bool EventHandler::handle_mouseup(const Gfx::IntPoint& position, unsigned button
|
|||
|
||||
bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned button, unsigned modifiers)
|
||||
{
|
||||
if (m_browsing_context.active_document())
|
||||
m_browsing_context.active_document()->update_layout();
|
||||
|
||||
if (!paint_root())
|
||||
return false;
|
||||
|
||||
|
@ -324,6 +333,9 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
|
|||
|
||||
bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned buttons, unsigned modifiers)
|
||||
{
|
||||
if (m_browsing_context.active_document())
|
||||
m_browsing_context.active_document()->update_layout();
|
||||
|
||||
if (!paint_root())
|
||||
return false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue