mirror of
https://github.com/brl/mutter.git
synced 2025-04-09 19:59:38 +00:00
context: Add 'started' and 'prepare-shutdown' signals
The backend is changed to listen to 'prepare-shutdown' and forward, but the 'started' signal will be used later. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2716>
This commit is contained in:
parent
a897542876
commit
c1982218e1
@ -115,8 +115,6 @@ struct _MetaBackendClass
|
||||
|
||||
void meta_backend_destroy (MetaBackend *backend);
|
||||
|
||||
void meta_backend_prepare_shutdown (MetaBackend *backend);
|
||||
|
||||
META_EXPORT_TEST
|
||||
ClutterBackend * meta_backend_get_clutter_backend (MetaBackend *backend);
|
||||
|
||||
|
@ -525,6 +525,13 @@ on_stage_shown_cb (MetaBackend *backend)
|
||||
determine_hotplug_pointer_visibility (seat));
|
||||
}
|
||||
|
||||
static void
|
||||
on_prepare_shutdown (MetaContext *context,
|
||||
MetaBackend *backend)
|
||||
{
|
||||
g_signal_emit (backend, signals[PREPARE_SHUTDOWN], 0);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_backend_real_post_init (MetaBackend *backend)
|
||||
{
|
||||
@ -585,6 +592,9 @@ meta_backend_real_post_init (MetaBackend *backend)
|
||||
}
|
||||
|
||||
meta_monitor_manager_post_init (priv->monitor_manager);
|
||||
|
||||
g_signal_connect (priv->context, "prepare-shutdown",
|
||||
G_CALLBACK (on_prepare_shutdown), backend);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -1581,12 +1591,6 @@ meta_backend_get_clutter_backend (MetaBackend *backend)
|
||||
return clutter_context_get_backend (clutter_context);
|
||||
}
|
||||
|
||||
void
|
||||
meta_backend_prepare_shutdown (MetaBackend *backend)
|
||||
{
|
||||
g_signal_emit (backend, signals[PREPARE_SHUTDOWN], 0);
|
||||
}
|
||||
|
||||
MetaBackendCapabilities
|
||||
meta_backend_get_capabilities (MetaBackend *backend)
|
||||
{
|
||||
|
@ -51,6 +51,16 @@ enum
|
||||
|
||||
static GParamSpec *obj_props[N_PROPS];
|
||||
|
||||
enum
|
||||
{
|
||||
STARTED,
|
||||
PREPARE_SHUTDOWN,
|
||||
|
||||
N_SIGNALS
|
||||
};
|
||||
|
||||
static guint signals[N_SIGNALS];
|
||||
|
||||
typedef enum _MetaContextState
|
||||
{
|
||||
META_CONTEXT_STATE_INIT,
|
||||
@ -431,6 +441,8 @@ meta_context_start (MetaContext *context,
|
||||
|
||||
priv->state = META_CONTEXT_STATE_STARTED;
|
||||
|
||||
g_signal_emit (context, signals[STARTED], 0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -667,8 +679,7 @@ meta_context_dispose (GObject *object)
|
||||
MetaContext *context = META_CONTEXT (object);
|
||||
MetaContextPrivate *priv = meta_context_get_instance_private (context);
|
||||
|
||||
if (priv->backend)
|
||||
meta_backend_prepare_shutdown (priv->backend);
|
||||
g_signal_emit (context, signals[PREPARE_SHUTDOWN], 0);
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
if (priv->wayland_compositor)
|
||||
@ -738,6 +749,21 @@ meta_context_class_init (MetaContextClass *klass)
|
||||
G_PARAM_EXPLICIT_NOTIFY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_properties (object_class, N_PROPS, obj_props);
|
||||
|
||||
signals[STARTED] =
|
||||
g_signal_new ("started",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
signals[PREPARE_SHUTDOWN] =
|
||||
g_signal_new ("prepare-shutdown",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user