summaryrefslogtreecommitdiff
path: root/cpufreq/src/cpufreq-applet.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2018-06-10 01:55:22 -0400
committerlukefromdc <[email protected]>2018-06-11 14:23:44 -0400
commitf0b33d1125f60bd5fe8b605d88efd37b2b0b2427 (patch)
treec7e2052b416d02a6040aa3235f8e117446bac81f /cpufreq/src/cpufreq-applet.c
parent618ab266bc51aa7c7e880b8459f4389a12c3f21e (diff)
downloadmate-applets-f0b33d1125f60bd5fe8b605d88efd37b2b0b2427.tar.bz2
mate-applets-f0b33d1125f60bd5fe8b605d88efd37b2b0b2427.tar.xz
Cpufreq: Force the frequency label to render if frequencies are not found right away
Use a default "---" label until frequency values are found
Diffstat (limited to 'cpufreq/src/cpufreq-applet.c')
-rw-r--r--cpufreq/src/cpufreq-applet.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c
index 58cd64a6..c8f81e8f 100644
--- a/cpufreq/src/cpufreq-applet.c
+++ b/cpufreq/src/cpufreq-applet.c
@@ -688,7 +688,13 @@ cpufreq_applet_update (CPUFreqApplet *applet, CPUFreqMonitor *monitor)
unit_label = cpufreq_utils_get_frequency_unit (freq);
if (applet->show_freq) {
- gtk_label_set_text (GTK_LABEL (applet->label), freq_label);
+ /*Force the label to render if frequencies are not found right away*/
+ if (freq_label == NULL){
+ gtk_label_set_text (GTK_LABEL (applet->label),"---");
+ }
+ else{
+ gtk_label_set_text (GTK_LABEL (applet->label), freq_label);
+ }
/*Hold the largest size set by any jumping text */
gtk_widget_get_preferred_size (GTK_WIDGET (applet->label),&req, NULL);
gtk_widget_set_size_request (GTK_WIDGET (applet->label),req.width, req.height);