1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 14:54:59 +00:00

LibGUI+WindowServer: Mark minimized window backing stores as volatile

WindowServer will now send out a WindowStateChanged message to clients
when one of their windows is minimized.

This is then forwarded to the GWindow, which will try to mark its
underlying window backing store as volatile.

This allows the kernel to steal the memory used by minimized windows
in case it starts running low. Very cool! :^)
This commit is contained in:
Andreas Kling 2019-12-26 12:06:07 +01:00
parent 23591f2a95
commit 519cb80a96
6 changed files with 27 additions and 0 deletions

View file

@ -295,3 +295,9 @@ void GWindowServerConnection::handle(const WindowClient::DragCancelled&)
{
GDragOperation::notify_cancelled({});
}
void GWindowServerConnection::handle(const WindowClient::WindowStateChanged& message)
{
if (auto* window = GWindow::from_window_id(message.window_id()))
window->notify_state_changed({}, message.minimized());
}