diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/xfpm-inhibit.c | 16 | ||||
-rw-r--r-- | src/xfpm-inhibit.h | 5 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/xfpm-inhibit.c b/src/xfpm-inhibit.c index b8440411..a4ef3863 100644 --- a/src/xfpm-inhibit.c +++ b/src/xfpm-inhibit.c @@ -65,6 +65,7 @@ typedef struct enum { HAS_INHIBIT_CHANGED, + INHIBIT_LIST_CHANGED, LAST_SIGNAL }; @@ -99,7 +100,11 @@ xfpm_inhibit_has_inhibit_changed (XfpmInhibit *inhibit) inhibit->priv->inhibited = TRUE; g_signal_emit (G_OBJECT(inhibit), signals[HAS_INHIBIT_CHANGED], 0, inhibit->priv->inhibited); } - + + /* Always emite the INHIBIT_LIST_CHANGED for any change so the panel plugin + * stays in sync */ + g_signal_emit (G_OBJECT(inhibit), signals[INHIBIT_LIST_CHANGED], 0, inhibit->priv->inhibited); + return inhibit->priv->inhibited; } @@ -218,6 +223,15 @@ xfpm_inhibit_class_init(XfpmInhibitClass *klass) g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN); + signals[INHIBIT_LIST_CHANGED] = + g_signal_new ("inhibitors-list-changed", + XFPM_TYPE_INHIBIT, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(XfpmInhibitClass, inhibitors_list_changed), + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, 1, G_TYPE_BOOLEAN); + object_class->finalize = xfpm_inhibit_finalize; g_type_class_add_private (klass, sizeof (XfpmInhibitPrivate)); diff --git a/src/xfpm-inhibit.h b/src/xfpm-inhibit.h index 5b66fc04..7ad5f9e0 100644 --- a/src/xfpm-inhibit.h +++ b/src/xfpm-inhibit.h @@ -41,9 +41,12 @@ typedef struct typedef struct { GObjectClass parent_class; - + + /* signals */ void (*has_inhibit_changed) (XfpmInhibit *inhibit, gboolean is_inhibit); + void (*inhibitors_list_changed) (XfpmInhibit *inhibit, + gboolean is_inhibit); } XfpmInhibitClass; |