Skip to content

Commit

Permalink
Cpufreq: Force the frequency label to render if frequencies are not f…
Browse files Browse the repository at this point in the history
…ound right away

Use a default "---" label until frequency values are found
  • Loading branch information
lukefromdc committed Jun 11, 2018
1 parent 704fe98 commit 0a00b7c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cpufreq/src/cpufreq-applet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0a00b7c

Please sign in to comment.