<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - desktop-shell panel clock should be configurable"
href="https://bugs.freedesktop.org/show_bug.cgi?id=57583#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - desktop-shell panel clock should be configurable"
href="https://bugs.freedesktop.org/show_bug.cgi?id=57583">bug 57583</a>
from <span class="vcard"><a class="email" href="mailto:oreaus@gmail.com" title="Scott Moreau <oreaus@gmail.com>"> <span class="fn">Scott Moreau</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=57583#c0">comment #0</a>)
<span class="quote">> As mentioned in <a class="bz_bug_link
bz_status_VERIFIED bz_closed"
title="VERIFIED NOTABUG - Weston, when idle, emits a wakeup about every minute"
href="show_bug.cgi?id=57562">bug #57562</a>, the desktop-shell panel clock ought to be
> configurable. Krh put the following ideas forward:
>
> 1) panel clock configurable by a string enum-- user can specify
> none/minutes/seconds
>
> 2) panel clock configurable by a strftime() string with 'none' as a
> special case
>
> The second option would require more input validation than the first, but
> either is possible.</span >
I looked into this and wrote a patch to make the clock format configurable.
When I did this I noticed the the width allocated for the clock is hard coded
to 170. I figured it would make sense to determine the width based on the text
extents from cairo. However when I tried this I noticed an oddity in toytoolkit
where window_get_surface() returns NULL before the first redraw (because
window_set_surface() is called from window_create_surface() which creates a
surface on each redraw). This means that there is no valid cairo surface
available from window_get_surface() when the first widget resize is called. I
managed to get it working by calling window_create_surface() when the window is
created in toytoolkit, but this requires setting a non-zero allocation size. It
does not necessarily have to be a valid size, just something that allows us to
create the initial cairo_surface. (i.e. width=1, height=1 works)
Kristian suggested we can make font configurable too.
One other thing I will mention here is the clock update timer must be
configured based on the format. The default is 60 seconds, but for formats
including types such as "%s", "%S" and "%T", the timer then needs to be set to
fire every second. The function I wrote uses strstr() to check for these but
maybe there's a better way to solve this problem.
I am not posting a patch at this time, because of these issues.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>