projects
/
psensor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added support of enable/disable unity launcher count
[psensor.git]
/
src
/
unity
/
ui_unity.c
diff --git
a/src/unity/ui_unity.c
b/src/unity/ui_unity.c
index
8b790f5
..
cb62458
100644
(file)
--- a/
src/unity/ui_unity.c
+++ b/
src/unity/ui_unity.c
@@
-23,17
+23,29
@@
static int initialized;
static UnityLauncherEntry *psensor_entry;
static int initialized;
static UnityLauncherEntry *psensor_entry;
+static unsigned int last_visible = -1;
-void ui_unity_launcher_entry_update(struct psensor **sensors)
+void ui_unity_launcher_entry_update(struct psensor **sensors,
+ unsigned int show)
{
if (!initialized) {
psensor_entry = unity_launcher_entry_get_for_desktop_file
("psensor.desktop");
{
if (!initialized) {
psensor_entry = unity_launcher_entry_get_for_desktop_file
("psensor.desktop");
- unity_launcher_entry_set_count_visible(psensor_entry, TRUE);
+
unity_launcher_entry_set_count(psensor_entry, 0);
initialized = 1;
}
unity_launcher_entry_set_count(psensor_entry, 0);
initialized = 1;
}
+ if (last_visible != show) {
+ if (show)
+ unity_launcher_entry_set_count_visible(psensor_entry,
+ TRUE);
+ else
+ unity_launcher_entry_set_count_visible(psensor_entry,
+ FALSE);
+ last_visible = show;
+ }
+
if (sensors && *sensors) {
struct psensor *s = *sensors;
double v = psensor_get_current_value(s);
if (sensors && *sensors) {
struct psensor *s = *sensors;
double v = psensor_get_current_value(s);