Some batteries support charge thresholds and when the upper limit is set to a number less than 100 percent and it reaches that limit and it is connected to the charger the battery state will be "Not charging".
It doesn't charge anymore despite it's not full.
Some battery drivers will remove their sysfs directory when the
battery goes from charging to discharging, or vice verse.
This caused yambar’s battery module to terminate, resulting in the
last known battery state to “freeze”.
With this patch, failure to read the battery directory the *first*
time is still considered a hard failure, resulting in an error message
and then termination.
However, subsequent failures, i.e. while polling the battery state,
is *not* considered fatal; we simply don’t update the bar, and retry
again the next poll interval. Error messages are still logged however.
Closes#44
This is already being done in the initial query response. Not doing it
in the input event handler too leads to an assertion if there are
multiple devices with the same ID.
Hopefully fixes#54
a5bbf0b769 introduced text-run
shaping.
Do avoid having to re-shape non-changing strings every time the bar is
refreshed, the *particle* (i.e. not the exposable) caches the last
shaped text-run.
Then, in expose(), it then assumes that that cached text-run is
the *same* text-run as returned from begin_expose().
This is true in most cases, but *not* when a single particle is
re-used to instantiate multiple exposables, as is commonly done by
modules generating dynlists. For example, the i3/sway module.
This fixes it, by making the cache growable, and by adding a “lock” to
each cache entry.
The lock is set in begin_expose(), to indicate that this particular
cache entry is needed in expose().
If we can’t find a matching cache entry, we first try to find a free
“slot” by searching for either unused, or used-but-not-locked cache
entries.
If that fails, we grow the cache and add a new entry.
In expose(), we unset the lock.
Closes#47
This enables support for text shaping, and is required to render
e.g. 👩👩👧👧 correctly.
Since text-shaping is a fairly expensive operation, and since many
times the text is unchanged, we cache the last *rendered* string.
That is, we hash the instantiated string, and cache it along with the
text-run from fcft in the *particle* object (i.e. not the exposable).
This means two things:
* we only need to call fcft_text_run_rasterize() once per string
* if the string is the same as last time, we don’t have to call it at
all.