- Acquire lock once at start of update() and hold for entire function
- Remove redundant lock from queryActiveWorkspace() since it's only called from update()
This addresses code review feedback and makes the locking strategy clearer
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
Changed approach per maintainer feedback - instead of caching signal values,
just add isInt() check before accessing config_["signal"].asInt() in refresh()
methods. This is simpler and more minimal.
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
- Move GTK operations from IPC thread to GTK main thread in Window module
- Move GTK operations from IPC thread to GTK main thread in WindowCount module
- Move GTK style class operations from IPC thread to GTK main thread in Submap module
- Language and Workspaces modules already safe (only update internal state)
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
Cache signal value during module construction to avoid accessing JSON config
in signal handler context. This prevents crashes when signal field is missing
or not an integer type.
- Custom module: Cache signal_ value in constructor
- Image module: Cache signal_ value in constructor
- Both modules: Use cached value in refresh() method
Co-authored-by: Alexays <13947260+Alexays@users.noreply.github.com>
data_format was changed from always "ascii" to user-configurable,
but without a default. This caused cava to use "binary", calculating
height as 65535 instead of ascii_range, making bars always peak.
Allow selecting a hwmon device for the temperature module by its
name instead of a fixed hwmon path.
This avoids fragile configurations that break when new hwmon
devices are added and the kernel changes hwmon ordering.
The hwmon-name option is mutually exclusive with hwmon-path and
hwmon-path-abs to prevent ambiguous configurations.
Most modules support config fields like "format-<status>-<state>", so
the user can, for example, set a different format for batter when
unplugged _and_ under a given level. Wifi didn't support this. Change
the module to support format state based on signal strength.
It makes it find the first node that has adevice.id linked to the
default output if the default output doesn't have it (i.e. it is a
virtual output).
Useful if you want to control (and see) the volume of the actual output
and not the effect sink.
May need some polishing and/or style fixing, but it works.