LibGUI: Hold on to notification icon until NotificationServer responds

This broke when switching IPC messages to support move-only types.
This pattern is not ideal, but the real fix for this will be using fd
passing instead of shbufs.

Fixes #4955.
This commit is contained in:
Andreas Kling 2021-01-15 08:20:48 +01:00
parent a51fbb13e8
commit b8c3ea8b30
Notes: sideshowbarker 2024-07-18 23:51:58 +09:00

View File

@ -60,7 +60,8 @@ Notification::~Notification()
void Notification::show()
{
auto connection = NotificationServerConnection::construct();
connection->send_sync<Messages::NotificationServer::ShowNotification>(m_text, m_title, m_icon ? m_icon->to_shareable_bitmap(connection->server_pid()) : Gfx::ShareableBitmap());
auto icon = m_icon ? m_icon->to_shareable_bitmap(connection->server_pid()) : Gfx::ShareableBitmap();
connection->send_sync<Messages::NotificationServer::ShowNotification>(m_text, m_title, icon);
}
}