diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-18 04:37:49 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-18 04:37:49 +0100 |
commit | dff70021ab85615b1d1c377fb3ae66a7b0923f41 (patch) | |
tree | feb2f7a8a61da602ced109d245f068d0d989ab20 /Kernel/ProcessGUI.cpp | |
parent | 9d7da26b4ecde03255df2572d5bc9fd23da0ff7c (diff) | |
download | serenity-dff70021ab85615b1d1c377fb3ae66a7b0923f41.zip |
Make it possible to invalidate only a portion of a window.
Use this in Terminal to only invalidate rows where anything changed.
Diffstat (limited to 'Kernel/ProcessGUI.cpp')
-rw-r--r-- | Kernel/ProcessGUI.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Kernel/ProcessGUI.cpp b/Kernel/ProcessGUI.cpp index bdd0636ba1..417dac360e 100644 --- a/Kernel/ProcessGUI.cpp +++ b/Kernel/ProcessGUI.cpp @@ -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; } |