mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-04 08:01:51 +00:00
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:
parent
9d7da26b4e
commit
dff70021ab
Notes:
sideshowbarker
2024-07-19 16:00:37 +09:00
Author: https://github.com/awesomekling
Commit: dff70021ab
15 changed files with 91 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue