1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 10:07:43 +00:00

WindowServer+LibGUI: Pass window icons as shared buffers rather than paths.

Now that we support more than 2 clients per shared buffer, we can use them
for window icons. I didn't do that previously since it would have made the
Taskbar process unable to access the icons.

This opens up some nice possibilities for programmatically generated icons.
This commit is contained in:
Andreas Kling 2019-07-28 10:18:49 +02:00
parent 63619b9f7c
commit 841b2e5d13
21 changed files with 193 additions and 19 deletions

View file

@ -254,6 +254,23 @@ void WSWindow::event(CEvent& event)
break;
}
case WSEvent::WM_WindowIconBitmapChanged: {
auto& changed_event = static_cast<const WSWMWindowIconBitmapChangedEvent&>(event);
server_message.type = WSAPI_ServerMessage::Type::WM_WindowIconBitmapChanged;
server_message.wm.client_id = changed_event.client_id();
server_message.wm.window_id = changed_event.window_id();
server_message.wm.icon_buffer_id = changed_event.icon_buffer_id();
server_message.wm.icon_size = changed_event.icon_size();
// FIXME: Perhaps we should update the bitmap sharing list somewhere else instead?
ASSERT(client());
dbg() << "WindowServer: Sharing icon buffer " << changed_event.icon_buffer_id() << " with PID " << client()->client_pid();
if (share_buffer_with(changed_event.icon_buffer_id(), client()->client_pid()) < 0) {
ASSERT_NOT_REACHED();
}
break;
}
case WSEvent::WM_WindowRectChanged: {
auto& changed_event = static_cast<const WSWMWindowRectChangedEvent&>(event);
server_message.type = WSAPI_ServerMessage::Type::WM_WindowRectChanged;