X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Funity%2Fui_unity.c;h=cb624586adb35978bef1e8f0c46dd35f64bc4e75;hb=85c2ac4475d8e9815c96b09299f1b03ae8071da3;hp=8b790f5eae71a72fdea77f8ac71414a3cf7c5c5c;hpb=d92bb15bcf27f77b27cea7554686fce24f86e042;p=psensor.git diff --git a/src/unity/ui_unity.c b/src/unity/ui_unity.c index 8b790f5..cb62458 100644 --- a/src/unity/ui_unity.c +++ b/src/unity/ui_unity.c @@ -23,17 +23,29 @@ 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"); - unity_launcher_entry_set_count_visible(psensor_entry, TRUE); + 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);