<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15435</bug_id>
          
          <creation_ts>2024-03-07 15:16:35 +0000</creation_ts>
          <short_desc>Clock in the desktop panel resizes</short_desc>
          <delta_ts>2026-05-21 15:55:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Matchbox</product>
          <component>matchbox</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>newcomer</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>frezidok1</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>98411</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-03-07 15:16:35 +0000</bug_when>
    <thetext>The clock in the desktop panel resizes depending on whether the current time has 3 or 4 digits and this moves other icons. For now for screenshot purposes we&apos;re just masking out the icons as well to avoid comparison failures.

Ideally the pango API to work out a fixed width should be used and the space taken by the clock/time should remain consistent regardless of the time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99806</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2024-10-10 11:15:05 +0000</bug_when>
    <thetext>This can be done with pango_font_metrics_get_approximate_digit_width().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105199</commentid>
    <comment_count>2</comment_count>
    <who name="Dmitry Sakhonchik">frezidok1</who>
    <bug_when>2026-04-23 07:51:46 +0000</bug_when>
    <thetext>Hi. The bug is still relevant? I tried to reproduce it on scarthgap but it seems the clock always has 4 digits (e.g. 07:50) and no resize happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105386</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-05-07 20:49:55 +0000</bug_when>
    <thetext>Ross, question for you from Dmitry</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105394</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2026-05-08 14:04:22 +0000</bug_when>
    <thetext>The original comment is wrong as it doesn&apos;t show single digit hours, but as digits are different widths the label will subtly change size over time.

We can probably tell the font to use &apos;tabular numbers&apos; which are all the same width, mitigating this.  It would be interesting to see if this code does the right thing when creating the label in clock.c:

PangoAttrList *attrs = pango_attr_list_new();
PangoAttribute *attr = pango_attr_font_features_new(&quot;tnum=1&quot;);
attr-&gt;start_index = 0;
attr-&gt;end_index = G_MAXUINT;
pango_attr_list_insert(attrs, attr);
gtk_label_set_attributes(GTK_LABEL(label), attrs);
pango_attr_list_unref(attrs);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105484</commentid>
    <comment_count>5</comment_count>
    <who name="Dmitry Sakhonchik">frezidok1</who>
    <bug_when>2026-05-18 13:40:36 +0000</bug_when>
    <thetext>Ross, I have tried both of your approaches. 

Approach with PangoAttribute simply didn&apos;t change widget&apos;s behavour at all, maybe because default font doesn&apos;t support tnum (it&apos;s just a guess, I haven&apos;t checked it).
Approach with get_approximate_digit_width does not fit because we have to take in accont &quot;:&quot; character and it makes things much more complicated.

I decided that we could just take the widest time string possible (88:88), measure it and set its width as widget&apos;s width. I tested it and it seems to work. I will be glad to hear your opinion on this.

Patch: https://patchwork.yoctoproject.org/project/oe-core/patch/20260518132106.1296563-1-frezidok1@gmail.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105537</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2026-05-21 15:55:48 +0000</bug_when>
    <thetext>Merged, thanks Dmitry! I&apos;ll send the recipe update as I have the patch to hand.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>