mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
LibGUI: Make a new connection to NotificationServer each time
Since NotificationServer is a spawn-on-demand + die-when-not-used type of service, we can't expect a singleton connection to it to remain open and useful. We solve this for now by making a new IPC connection for every new notification sent. Maybe there's a better solution for this.
This commit is contained in:
parent
bc7a9097a7
commit
96c7e2cd6d
Notes:
sideshowbarker
2024-07-19 08:06:54 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/96c7e2cd6d4
1 changed files with 2 additions and 9 deletions
|
@ -32,17 +32,10 @@ Notification::~Notification()
|
|||
{
|
||||
}
|
||||
|
||||
static NotificationServerConnection& notification_server_connection()
|
||||
{
|
||||
static NotificationServerConnection* connection;
|
||||
if (!connection)
|
||||
connection = &NotificationServerConnection::construct().leak_ref();
|
||||
return *connection;
|
||||
}
|
||||
|
||||
void Notification::show()
|
||||
{
|
||||
notification_server_connection().post_message(Messages::NotificationServer::ShowNotification(m_text, m_title));
|
||||
auto connection = NotificationServerConnection::construct();
|
||||
connection->post_message(Messages::NotificationServer::ShowNotification(m_text, m_title));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue