Skip to content
Browse files

Cpufreq: Force the frequency label to render if frequencies are not f…

…ound right away

Use a default "---" label until frequency values are found
  • Loading branch information...
lukefromdc committed Jun 10, 2018
1 parent 618ab26 commit f0b33d1125f60bd5fe8b605d88efd37b2b0b2427
Showing with 7 additions and 1 deletion.
  1. +7 −1 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),"---");
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);

0 comments on commit f0b33d1

Please sign in to comment.
You can’t perform that action at this time.