[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#423712: wmacpi 2.1-6 always redraws X window



Package: wmacpi
Version: 2.1-6

Wmacpi has a subtle bug which renders alot of its redundant-drawing-avoidance
logic pointless, and contributes significantly to it's excessive CPU usage.

The problem is on line 418 of wmacpi.c:
    enum panel_states power = PS_NULL;

it should be:
    static enum panel_states power = PS_NULL;

Every time set_power_panel() is called (every iteration of the main loop)
the power variable is initialized to PS_NULL.  This causes the following 
set_power_panel() logic to determine the power status has changed, the glyph is
then redrawn erroneously and thus the whole X window gets updated.

Adding the static prefix causes the power variable to be initialized once to
PS_NULL.  Then the state of the power varible persists across calls, which is
clearly the intended design.

I didnt bother with a proper patch since it's literally one line changed.

I've cc'd the upstream maintainer as well.

Regards,
Vito Caputo



Reply to: