mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 22:52:30 +02:00
fix: compilation errors with cpp_std=c++20
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.
This commit is contained in:
@ -233,7 +233,7 @@ auto Workspaces::update() -> void {
|
||||
std::string output = (*it)["name"].asString();
|
||||
if (config_["format"].isString()) {
|
||||
auto format = config_["format"].asString();
|
||||
output = fmt::format(format, fmt::arg("icon", getIcon(output, *it)),
|
||||
output = fmt::format(fmt::runtime(format), fmt::arg("icon", getIcon(output, *it)),
|
||||
fmt::arg("value", output), fmt::arg("name", trimWorkspaceName(output)),
|
||||
fmt::arg("index", (*it)["num"].asString()));
|
||||
}
|
||||
@ -259,11 +259,9 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) {
|
||||
try {
|
||||
if (node["target_output"].isString()) {
|
||||
ipc_.sendCmd(IPC_COMMAND,
|
||||
fmt::format(workspace_switch_cmd_ + "; move workspace to output \"{}\"; " +
|
||||
workspace_switch_cmd_,
|
||||
"--no-auto-back-and-forth", node["name"].asString(),
|
||||
node["target_output"].asString(), "--no-auto-back-and-forth",
|
||||
node["name"].asString()));
|
||||
fmt::format(persistent_workspace_switch_cmd_, "--no-auto-back-and-forth",
|
||||
node["name"].asString(), node["target_output"].asString(),
|
||||
"--no-auto-back-and-forth", node["name"].asString()));
|
||||
} else {
|
||||
ipc_.sendCmd(IPC_COMMAND, fmt::format("workspace {} \"{}\"",
|
||||
config_["disable-auto-back-and-forth"].asBool()
|
||||
|
Reference in New Issue
Block a user