All the mode or visibility changes require `wl_surface_commit` to be
applied. gtk-layer-shell will attempt to force GTK to commit, but may
fail if the surface has stopped receiving frame callbacks[^1].
Thus, we could get stuck in a state where the bar is hidden and unable
to regain visibility.
To address this, a new API has been added to gtk-layer-shell,
`gtk_layer_try_force_commit`, which does `wl_surface_commit` with the
necessary safety checks to avoid corrupting GTK internal state.
Note: this change bumps gtk-layer-shell requirement to 0.9.0.
[^1]: https://github.com/wmww/gtk-layer-shell/issues/185
This fixes a major inconsistency with the swaybar implementation of
these modes[^1]. `overlay` layer no longer has security implications due
to a wide adoption of `ext-session-lock`, so it's safe to use.
Following config will restore the previous behavior:
```json
"modes": {
"hide": { "layer": "top" },
"overlay": { "layer": "top" }
},
```
[^1]: 2f7247e08a
While looping over all the upower devices, the currently set device that will be rendered in the waybar, is overridden. Since the loop doesn't end when the device is found, the upDevice_ is overridden with NULL in the iteration for the next device.
Now we only override upDevice_ if the current device matches the constraints.
Fixes d2a719d67c ("Redo to minimize code duplication.")
Fixes#3267
Hyprland hasn't been using TCP sockets for IPC since the first release,
so this getaddrinfo call and its result was never needed.
Additionally, it leaks the `aiRes`, causing test failure under ASan.
We aren't including the hover detection on the revealer, so when the
animation fires we fire the leave event which starts an infinite loop of
enter/leave while we watch boxes move back and forth.
First of all in case when the number CPUs change
prevent out-of-bound index access in
waybar::modules::CpuUsage::getCpuUsage()
Secondly on Linux when updating CPU usage
read /sys/devices/system/cpu/present
and use it to detect the offline CPUs missing from /proc/stat
For offline CPUs report 0 usage and "offline" in the tooltip
Fixes issue #3498
On Linux one can test this functionality with:
echo 0 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu1/online
On non-Linux OSes I'm not sure how to detect offline CPUs,
so I didn't add the offline CPU detection there
but at least CPU number change should not cause a crash there anymore
or cause memory safety issues after this fix
"reload_style_on_change" would check if the target file is a symlink,
but only resolves the first link. If the symlink is acutally a chain of
symlink, such as what happens with NixOS's mkOutOfStoreSymlink, we will
not find the actual file style file.
Update the symlink resolution logic to walk down the symlink chain until
it finds a non-symlink. Also check against a the original filename
(which may be a symlink) to guard against infinitely looping on a
circular symlink chain.
Right now, for the tooltip, all times are shifted if shift-down/shift-up
actions are used. But it really only makes sense for this to apply to
the {calendar} replacement, so use shiftedNow there and now for all
the rest.