summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2016-02-26 18:53:15 +0300
committerEric Koegel <eric.koegel@gmail.com>2016-02-26 18:53:48 +0300
commit292d4c90535d54647c8759476d791fab4977ff41 (patch)
tree1a1c19f09c30f5966747fd0dad6222e448cda68b /src
parent7b1e006c8eaebf16a449b890416f3fea927f6d48 (diff)
downloadixfce4-power-manager-292d4c90535d54647c8759476d791fab4977ff41.tar.gz
Show inhibitors in the plugin menu (Bug #9090)
This patch now displays the applications that are inhibiting xfpm from doing power management in the plugin/systray menu.
Diffstat (limited to 'src')
-rw-r--r--src/xfpm-inhibit.c16
-rw-r--r--src/xfpm-inhibit.h5
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;