Make it possible to invalidate only a portion of a window.

Use this in Terminal to only invalidate rows where anything changed.
This commit is contained in:
Andreas Kling 2019-01-18 04:37:49 +01:00
parent 9d7da26b4e
commit dff70021ab
Notes: sideshowbarker 2024-07-19 16:00:37 +09:00
15 changed files with 91 additions and 15 deletions

View file

@ -99,16 +99,21 @@ int Process::gui$get_window_backing_store(int window_id, GUI_WindowBackingStoreI
return 0;
}
int Process::gui$invalidate_window(int window_id)
int Process::gui$invalidate_window(int window_id, const GUI_Rect* rect)
{
dbgprintf("%s<%u> gui$invalidate_window (window_id=%d)\n", name().characters(), pid(), window_id);
if (window_id < 0)
return -EINVAL;
if (rect && !validate_read_typed(rect))
return -EFAULT;
auto it = m_windows.find(window_id);
if (it == m_windows.end())
return -EBADWINDOW;
auto& window = *(*it).value;
WSEventLoop::the().post_event(&window, make<WSEvent>(WSEvent::WM_Invalidate));
auto event = make<WSEvent>(WSEvent::WM_Invalidate);
if (rect)
event->set_rect(*rect);
WSEventLoop::the().post_event(&window, move(event));
WSEventLoop::the().server_process().request_wakeup();
return 0;
}