backend: Tear down in dispose() instead of finalize()

This means backend implementations can have more control of the order of
how things are destroyed. To be precise, this will, in the next commit,
allow us to destroy the logind integration after the clutter backend
thus the libinput owning seat, that uses the logind integration to
release input devices.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1670>
This commit is contained in:
Jonas Ådahl
2021-01-19 22:14:01 +01:00
parent 05765daabf
commit db6bf9d14e
3 changed files with 30 additions and 15 deletions

View File

@ -848,7 +848,7 @@ initable_iface_init (GInitableIface *initable_iface)
}
static void
meta_backend_x11_finalize (GObject *object)
meta_backend_x11_dispose (GObject *object)
{
MetaBackend *backend = META_BACKEND (object);
MetaBackendX11 *x11 = META_BACKEND_X11 (object);
@ -871,7 +871,7 @@ meta_backend_x11_finalize (GObject *object)
priv->user_active_alarm = None;
}
G_OBJECT_CLASS (meta_backend_x11_parent_class)->finalize (object);
G_OBJECT_CLASS (meta_backend_x11_parent_class)->dispose (object);
}
static void
@ -880,7 +880,7 @@ meta_backend_x11_class_init (MetaBackendX11Class *klass)
MetaBackendClass *backend_class = META_BACKEND_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_backend_x11_finalize;
object_class->dispose = meta_backend_x11_dispose;
backend_class->create_clutter_backend = meta_backend_x11_create_clutter_backend;
backend_class->post_init = meta_backend_x11_post_init;
backend_class->grab_device = meta_backend_x11_grab_device;