1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 17:55:08 +00:00

LibGUI: Implement destroying individual windows without exiting the process.

This commit is contained in:
Andreas Kling 2019-01-30 20:03:52 +01:00
parent 5c25f0c4db
commit 37ab7b7a8c
8 changed files with 85 additions and 30 deletions

View file

@ -80,6 +80,8 @@ int Process::gui$destroy_window(int window_id)
auto it = m_windows.find(window_id);
if (it == m_windows.end())
return -EBADWINDOW;
auto message = make<WSMessage>(WSMessage::WM_DestroyWindow);
WSMessageLoop::the().post_message((*it).value.leakPtr(), move(message), true);
m_windows.remove(window_id);
return 0;
}