Bladeren bron

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.
Andreas Kling 4 jaren geleden
bovenliggende
commit
b8c3ea8b30
1 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 2 1
      Userland/Libraries/LibGUI/Notification.cpp

+ 2 - 1
Userland/Libraries/LibGUI/Notification.cpp

@@ -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);
 }
 
 }