feat: optimize cache usage when window titles aren't involved

pull/2563/head
Brenno Lemos 2023-10-09 14:49:38 -03:00
parent 387e54498e
commit f9a7ecf3a9
1 changed files with 6 additions and 1 deletions

View File

@ -816,7 +816,12 @@ void Workspaces::set_urgent_workspace(std::string windowaddress) {
} }
std::string Workspaces::get_rewrite(std::string window_class, std::string window_title) { std::string Workspaces::get_rewrite(std::string window_class, std::string window_title) {
std::string window_repr_key = fmt::format("class<{}> title<{}>", window_class, window_title); std::string window_repr_key;
if (any_window_rewrite_rule_uses_title_) {
window_repr_key = fmt::format("class<{}> title<{}>", window_class, window_title);
} else {
window_repr_key = fmt::format("class<{}>", window_class);
}
return window_rewrite_rules_.get(window_repr_key); return window_rewrite_rules_.get(window_repr_key);
} }