There were two main issues with fmtlib and C++20 mode:
- `fmt::format` defaults to compile-time argument checking and requires
using `fmt::runtime(format_string)` to bypass that.
- `std::format` implementation introduces conflicting declarations and
we have to specify the namespace for all `format`/`format_to` calls.
The first crash occurs when trying to parse the
ID of a workspace as an uint, since named
workspaces has negative IDs. This is fixed by
using ints for workspace IDs instead of uints.
The second crash occurs when converting a
workspace name that isn't a number to an integer.
This is fixed by wrapping std::stoi in a try
block and only sorting by number, when both names
can successfully be converted to integers.
The hyprland/window widget had an assertion ensuring that the output
from hyprctl matched the currently selected workspace id. However this
assertion fails if workspaces are switched too quickly, causing the
selected workspace to differ in id from the one in hyprctl, failing this
assertion which then crashes the entire program.
This fix simply changes this assertion into an if statement, and if a
mismatch is found, empty string is returned as the window name.
gtk requires some chars (<>&"') to be encoded for them to render
properly. `sanitize_str` sanitizes raw strings that have such chars and
returns a properly encoded string