Re: imonlcd 0x0 command turning off progress bar

Markus Dolze <[email protected]>
Newsgroups gmane.comp.sysutils.lcdproc
Message-ID <[email protected]>
On 15.10.2011 21:44, Yura Scheglyuk wrote:
>         Hi!
>
> On 15.10.2011 23:59, Eric Pooch wrote:
>
>> My solution would be to just properly cache the bar state during a
>> 0x0 or -1 output command. Otherwise 0x0 and -1 would not work as
>> intended in the protocol.
>> The problem is that there is currently no way to clear all of the icons
>> without clearing the bars.
>
> Now imonlcd driver assuming that 0x0 clear icons only. The simple
> solution is to modify driver that on 0x0 command it should clear the
> bar state too.
>

Currently there are two options:

   1. '-1' will turn all icons _and_ bars on. '0x0' will turn all icons
      _and_ bars off.
   2. '-1' will _not_ turn on the bars and '0x0' will _not_ turn them off.

1.) This Is current behavior and has not been changed since 0.5.4. The
bug is that bars do not turn on again after '0x0' if the same bar state
is sent again. This will be easy to fix.

2.) This is a change in the meaning of '-1' and '0x0' and will require
applications to be updated to additionally set and clear the bars.

I suggest to stay with 1.) and to just reset the last_output_bar_state
upon '-1' or '0x0'.


Additionally I see a possible problem in line 872:
state = p->last_output_state;

Immediately after that the function returns if state is the same as on
last update (line 876):
if (state == p->last_output_state && !(state & IMON_OUTPUT_CD_MASK)) {

So unless IMON_OUTPUT_CD_MASK is set (in a previous call), output() will
return upon updating the bars. Is this intended behavior?

Regards,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.