[mutter/wip/carlosg/startup-notification-fixes: 3/4] core: Add MetaStartupSequence::complete signal
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/startup-notification-fixes: 3/4] core: Add MetaStartupSequence::complete signal
- Date: Wed, 17 Apr 2019 09:04:40 +0000 (UTC)
commit 6b507281ffe8b3ef44d112908f6ec5ece975babe
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Apr 15 18:24:48 2019 +0200
core: Add MetaStartupSequence::complete signal
It was a vfunc so far, but we want things subscribing to it.
https://gitlab.gnome.org/GNOME/mutter/issues/541
src/core/startup-notification.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/src/core/startup-notification.c b/src/core/startup-notification.c
index abf4885f6..78edb47cf 100644
--- a/src/core/startup-notification.c
+++ b/src/core/startup-notification.c
@@ -59,6 +59,12 @@ enum
N_SEQ_PROPS
};
+enum
+{
+ SEQ_COMPLETE,
+ N_SEQ_SIGNALS
+};
+
enum
{
CHANGED,
@@ -67,6 +73,7 @@ enum
static guint sn_signals[N_SIGNALS];
static GParamSpec *sn_props[N_PROPS];
+static guint seq_signals[N_SEQ_SIGNALS];
static GParamSpec *seq_props[N_SEQ_PROPS];
typedef struct
@@ -253,6 +260,14 @@ meta_startup_sequence_class_init (MetaStartupSequenceClass *klass)
object_class->set_property = meta_startup_sequence_set_property;
object_class->get_property = meta_startup_sequence_get_property;
+ seq_signals[SEQ_COMPLETE] =
+ g_signal_new ("complete",
+ META_TYPE_STARTUP_SEQUENCE,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (MetaStartupSequenceClass, complete),
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 0);
+
seq_props[PROP_SEQ_ID] =
g_param_spec_string ("id",
"ID",
@@ -331,7 +346,6 @@ meta_startup_sequence_get_timestamp (MetaStartupSequence *seq)
void
meta_startup_sequence_complete (MetaStartupSequence *seq)
{
- MetaStartupSequenceClass *klass;
MetaStartupSequencePrivate *priv;
g_return_if_fail (META_IS_STARTUP_SEQUENCE (seq));
@@ -341,10 +355,7 @@ meta_startup_sequence_complete (MetaStartupSequence *seq)
return;
priv->completed = TRUE;
- klass = META_STARTUP_SEQUENCE_GET_CLASS (seq);
-
- if (klass->complete)
- klass->complete (seq);
+ g_signal_emit (seq, seq_signals[SEQ_COMPLETE], 0);
}
gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]