LibGUI: Process pending window updates after handling input events
Since input events may trigger window portions to be invalidated, rather than making a round trip to WindowServer to get paint events we can simply fake an immediate paint event and update the window contents more quickly. Improves #5881
This commit is contained in:
parent
edb6ada3ef
commit
7626f9e0bb
Notes:
sideshowbarker
2024-07-18 21:06:31 +09:00
Author: https://github.com/tomuta Commit: https://github.com/SerenityOS/serenity/commit/7626f9e0bbf Pull-request: https://github.com/SerenityOS/serenity/pull/5882
1 changed files with 6 additions and 2 deletions
|
@ -363,8 +363,12 @@ void Window::handle_mouse_event(MouseEvent& event)
|
|||
if (event.buttons() != 0 && !m_automatic_cursor_tracking_widget)
|
||||
m_automatic_cursor_tracking_widget = *result.widget;
|
||||
if (result.widget != m_global_cursor_tracking_widget.ptr())
|
||||
return result.widget->dispatch_event(*local_event, this);
|
||||
return;
|
||||
result.widget->dispatch_event(*local_event, this);
|
||||
|
||||
if (!m_pending_paint_event_rects.is_empty()) {
|
||||
MultiPaintEvent paint_event(move(m_pending_paint_event_rects), size());
|
||||
handle_multi_paint_event(paint_event);
|
||||
}
|
||||
}
|
||||
|
||||
void Window::handle_multi_paint_event(MultiPaintEvent& event)
|
||||
|
|
Loading…
Add table
Reference in a new issue