display: Add 'closing' signal

Emitted when the MetaDisplay is closing. Meant for clean up that depends
on things that will be torn down during closing.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
This commit is contained in:
Jonas Ådahl 2019-11-01 13:14:39 +01:00
parent 5e87d67e5f
commit 1f5b403524

View File

@ -156,6 +156,7 @@ enum
SHOWING_DESKTOP_CHANGED, SHOWING_DESKTOP_CHANGED,
RESTACKED, RESTACKED,
WORKAREAS_CHANGED, WORKAREAS_CHANGED,
CLOSING,
LAST_SIGNAL LAST_SIGNAL
}; };
@ -493,6 +494,12 @@ meta_display_class_init (MetaDisplayClass *klass)
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, 0, NULL, NULL, NULL,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
display_signals[CLOSING] =
g_signal_new ("closing",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_FOCUS_WINDOW, PROP_FOCUS_WINDOW,
@ -971,6 +978,8 @@ meta_display_close (MetaDisplay *display,
display->closing += 1; display->closing += 1;
g_signal_emit (display, display_signals[CLOSING], 0);
meta_compositor_unmanage (display->compositor); meta_compositor_unmanage (display->compositor);
meta_display_unmanage_windows (display, timestamp); meta_display_unmanage_windows (display, timestamp);