summaryrefslogtreecommitdiff
path: root/src/backends/meta-idle-monitor.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2018-05-16 12:08:54 +0100
committerFlorian Müllner <florian.muellner@gmail.com>2018-08-14 15:14:05 +0000
commit7c06e21e5ad83f85df03e1c3c9d1d791b1f2b37f (patch)
treedf0cd6323c16fdadf460afa6bb5c57ed6b6d46ee /src/backends/meta-idle-monitor.c
parent1bfa20929b36d06cc23667d1122175149615b56d (diff)
downloadmutter-7c06e21e5ad83f85df03e1c3c9d1d791b1f2b37f.tar.gz
idle-monitor: Store either 1 or 0 in the inhibited gboolean
Wrap the flag checking in !!(..) to make sure we always either store TRUE or FALSE in the gboolean.
Diffstat (limited to 'src/backends/meta-idle-monitor.c')
-rw-r--r--src/backends/meta-idle-monitor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backends/meta-idle-monitor.c b/src/backends/meta-idle-monitor.c
index 76a7ee786..6b183fa8c 100644
--- a/src/backends/meta-idle-monitor.c
+++ b/src/backends/meta-idle-monitor.c
@@ -226,7 +226,7 @@ meta_idle_monitor_inhibited_actions_changed (GDBusProxy *session,
{
gboolean inhibited;
- inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
+ inhibited = !!(g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE);
g_variant_unref (v);
if (!inhibited)
@@ -265,7 +265,8 @@ meta_idle_monitor_init (MetaIdleMonitor *monitor)
"InhibitedActions");
if (v)
{
- monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
+ monitor->inhibited = !!(g_variant_get_uint32 (v) &
+ GSM_INHIBITOR_FLAG_IDLE);
g_variant_unref (v);
}
}