aboutsummaryrefslogtreecommitdiff
path: root/src/flashlight.c
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2023-02-11 01:27:40 +0100
committerRobert Tari <robert@tari.in>2023-02-12 20:34:36 +0100
commit8ec14e26e24b823f6be26ff36b428781a75c6bdf (patch)
treebb20df17c22ac77d3ff2f0c31f1e6f7df5e266fa /src/flashlight.c
parenta7c39af50ee5e30eb611fb87482aaf8c2b44685d (diff)
downloadayatana-indicator-power-8ec14e26e24b823f6be26ff36b428781a75c6bdf.tar.gz
ayatana-indicator-power-8ec14e26e24b823f6be26ff36b428781a75c6bdf.tar.bz2
ayatana-indicator-power-8ec14e26e24b823f6be26ff36b428781a75c6bdf.zip
Handle state changes for flashlight switch
fixes https://gitlab.com/ubports/development/core/packaging/ayatana-indicators/ayatana-indicator-power/-/issues/5
Diffstat (limited to 'src/flashlight.c')
-rw-r--r--src/flashlight.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/flashlight.c b/src/flashlight.c
index 064bd31..0a68af2 100644
--- a/src/flashlight.c
+++ b/src/flashlight.c
@@ -1,5 +1,6 @@
/*
* Copyright 2017 The UBports project
+ * Copyright 2023 Robert Tari
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
@@ -15,6 +16,7 @@
*
* Authors:
* Marius Gripsgard <marius@ubports.com>
+ * Robert Tari <robert@tari.in>
*/
#include "flashlight.h"
@@ -145,7 +147,7 @@ toggle_flashlight_action(GAction *action,
toggled = toggle_flashlight_action_simple();
if (toggled)
- g_action_change_state(action, g_variant_new_boolean(!activated));
+ g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean(!activated));
}
int