Hello Gereon,

thanks for stepping in.

As I'm the one who added this alignment in the first place [1], I
somewhat feel obligated to answer here :-)
At that time, I did not think about nanosleep() being interupted.

I haven't checked the timeline, but that feature probably has been added later and nobody noticed the consequences.


Can you describe under which circumstances i3status receives an USR1?
I've never noticed such a behavior...

The signal has been added to be able to force a refresh of the output from the outside. The most common example is to refresh the status if the system volume has been changed (commonly done right in the i3 config).


What would be your preferred solution here? As for me, we must decide on
what we consider more important (the implementation is easy in either
case): The overall number of refreshs? Have nice numbers?

It's really a minor issue, but I think the given interval time should matter. And yes, the number of refreshes increases if the alignment is performed on each update. Personally, I don't see a need for alignment at all, but it's no problem to support both, so this seems the way to go.


Possible solutions:
1) We could suppress or defer the signal and continue sleeping until the
proper number of seconds have passed. Not what I'd like to do...
2) We could refresh and start with the intervals from there. This
however means that we drop the alignment. This basically amounts to the
code before I changed it.
3) We could refresh, start with the intervals from there and realign
every minute or so. In this case, we have another shorter interval right
before a new minute starts and "ugly" numbers in between.
4) We could refresh and return to the alignment directly afterwards.
That is what happens right now.

It can happen quite often. I for one force an update on every window focus change.


As I don't care about an additional refresh once in a while, I'd go for
the nice numbers... What are your opinions?

I'm about to submit a patch that will ensure that the minute alignment will be performed only once per minute. This ensures the given interval is obeyed as much as possible, but still perform the alignment. The best of both worlds :)

Cheers,
  Marco

Reply via email to