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

LibGUI: Add getter/setter for GUI::Window modified state

This state lives in WindowServer and has no local copy in the client
process for now. This may turn out to be a performance issue, and if
it does we can easily cache it.
This commit is contained in:
Andreas Kling 2021-05-01 18:22:29 +02:00
parent 492464f4c1
commit 2fa765bbd5
2 changed files with 18 additions and 1 deletions

View file

@ -1084,4 +1084,18 @@ void Window::set_menubar(RefPtr<Menubar> menubar)
}
}
bool Window::is_modified() const
{
if (!m_window_id)
return false;
return WindowServerConnection::the().send_sync<Messages::WindowServer::IsWindowModified>(m_window_id)->modified();
}
void Window::set_modified(bool modified)
{
if (!m_window_id)
return;
WindowServerConnection::the().post_message(Messages::WindowServer::SetWindowModified(m_window_id, modified));
}
}