core: Shuffle startup notification object creation

Hook properly to MetaDisplay, instead of having it be a singleton.
This commit is contained in:
Carlos Garnacho 2018-08-22 22:51:26 +02:00 committed by Georges Basile Stavracas Neto
parent 8a10196382
commit 4a69a0d7f7
3 changed files with 6 additions and 11 deletions

View File

@ -761,7 +761,7 @@ meta_display_open (void)
display->workspace_manager = meta_workspace_manager_new (display); display->workspace_manager = meta_workspace_manager_new (display);
display->startup_notification = meta_startup_notification_get (display); display->startup_notification = meta_startup_notification_new (display);
g_signal_connect (display->startup_notification, "changed", g_signal_connect (display->startup_notification, "changed",
G_CALLBACK (on_startup_notification_changed), display); G_CALLBACK (on_startup_notification_changed), display);

View File

@ -50,7 +50,7 @@ G_DECLARE_DERIVABLE_TYPE (MetaStartupSequence,
GObject) GObject)
MetaStartupNotification * MetaStartupNotification *
meta_startup_notification_get (MetaDisplay *display); meta_startup_notification_new (MetaDisplay *display);
gboolean meta_startup_notification_handle_xevent (MetaStartupNotification *sn, gboolean meta_startup_notification_handle_xevent (MetaStartupNotification *sn,
XEvent *xevent); XEvent *xevent);

View File

@ -540,16 +540,11 @@ meta_startup_notification_class_init (MetaStartupNotificationClass *klass)
} }
MetaStartupNotification * MetaStartupNotification *
meta_startup_notification_get (MetaDisplay *display) meta_startup_notification_new (MetaDisplay *display)
{ {
static MetaStartupNotification *notification = NULL; return g_object_new (META_TYPE_STARTUP_NOTIFICATION,
"display", display,
if (!notification) NULL);
notification = g_object_new (META_TYPE_STARTUP_NOTIFICATION,
"display", display,
NULL);
return notification;
} }
GSList * GSList *