The Hyprland IPC helper cached the socket folder with the first instance
signature already appended, so later calls ignored their instanceSig argument
and always reused the first path. That made the helper violate its own API even
though most real Waybar sessions only talk to a single Hyprland instance.
Cache only the base socket directory and append the requested signature per
lookup. This fixes correctness for tests, nested or debug multi-instance
setups, and future code that needs to resolve a different signature, without
claiming support for one Waybar process managing multiple Hyprland sessions.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
- Replaced pass-by-value std::string parameters with const std::string&
or std::string_view to prevent SSO overallocations.
- Refactored static mapping functions in UPower to return
std::string_view instead of constructing std::string literals, enabling
perfect cache locality.
- Optimized string concatenation in hot loops (network IPs, inhibitor
lists, sway window marks) by using std::string::append() and
pre-reserving capacity instead of overloaded operator+ which produces
temporary heap instances.
These optimizations reduce high-frequency memory churn and overall heap
fragmentation within the main rendering loops.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
Command tests did not assert behavior when exec fails in child processes.
I added deterministic regression coverage that forces execl/execlp failure and
verifies non-zero exit status propagation for both open() and forkExec paths.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
The hyprland IPC fixture was no longer used by the current test setup.
I removed the dead fixture so the test code reflects the actual execution path
and is easier to maintain.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
Hyprland tests did not explicitly verify descriptor behavior on key failure
paths.
I added focused tests for missing instance signature and connect-failure paths
that assert file descriptor counts stay stable across repeated attempts.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
SafeSignal could queue events forever when worker threads emitted faster than
the main loop could consume, which risks memory growth and stale updates.
I added a queue cap with a drop-oldest policy so growth stays bounded under
burst load, plus a regression test that validates bounded delivery.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
SleeperThread concurrency paths needed stress coverage around wake/stop races.
I added a subprocess stress test that repeatedly interleaves wake_up() and
stop() and verifies the worker exits cleanly.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
We needed a regression test for reassignment safety after lifecycle fixes.
I added a subprocess test that reassigns SleeperThread workers and verifies the
process exits normally instead of terminating.
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
Allows us to disable modules entirely when socket connection isn't
working. This is similar to how sway handles their socket connections
disabling modules. This supports a single waybar config for multiple
IPCs.
- Add tests for global locale.
- Warn about missing locales.
- Downgrade REQUIRE to CHECK.
- Skip tests if localized formatting does not work as expected.
The structure was used to pass the locale instance to the date
formatter. All the supported versions of `fmt` are passing the locale
parameter via `FormatContext.locale()` so we can remove the struct and
simplify the code.
While we at it, drop `date::make_zoned` in favor of CTAD on a
`date::zoned_time` constructor.