[Wayland-bugs] [Bug 57583] desktop-shell panel clock should be configurable

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Nov 27 11:19:03 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=57583

--- Comment #1 from Scott Moreau <oreaus at gmail.com> ---
(In reply to comment #0)
> As mentioned in bug #57562, 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.


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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-bugs/attachments/20121127/96b2c9fd/attachment-0001.html>


More information about the Wayland-bugs mailing list