mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:27:45 +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
15 changed files with 91 additions and 15 deletions
|
@ -195,7 +195,7 @@ public:
|
|||
int gui$create_window(const GUI_CreateWindowParameters*);
|
||||
int gui$destroy_window(int window_id);
|
||||
int gui$get_window_backing_store(int window_id, GUI_WindowBackingStoreInfo*);
|
||||
int gui$invalidate_window(int window_id);
|
||||
int gui$invalidate_window(int window_id, const GUI_Rect*);
|
||||
|
||||
DisplayInfo get_display_info();
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ static dword handle(RegisterDump& regs, dword function, dword arg1, dword arg2,
|
|||
case Syscall::SC_gui_get_window_backing_store:
|
||||
return current->gui$get_window_backing_store((int)arg1, (GUI_WindowBackingStoreInfo*)arg2);
|
||||
case Syscall::SC_gui_invalidate_window:
|
||||
return current->gui$invalidate_window((int)arg1);
|
||||
return current->gui$invalidate_window((int)arg1, (const GUI_Rect*)arg2);
|
||||
default:
|
||||
kprintf("<%u> int0x80: Unknown function %u requested {%x, %x, %x}\n", current->pid(), function, arg1, arg2, arg3);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue