mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 22:55:23 +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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user