From 0a00b7cd3601a190d464dd52beff9df7cfb1ff0f Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 10 Jun 2018 01:55:22 -0400 Subject: Cpufreq: Force the frequency label to render if frequencies are not found right away Use a default "---" label until frequency values are found --- cpufreq/src/cpufreq-applet.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c index 63450791..74982354 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); -- cgit v1.2.1