mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor: lint
This commit is contained in:
@ -79,11 +79,8 @@ void BarIpcClient::onIpcEvent(const struct Ipc::ipc_response& res) {
|
||||
}
|
||||
|
||||
void BarIpcClient::onConfigUpdate(const swaybar_config& config) {
|
||||
spdlog::info("config update for {}: id {}, mode {}, hidden_state {}",
|
||||
bar_.bar_id,
|
||||
config.id,
|
||||
config.mode,
|
||||
config.hidden_state);
|
||||
spdlog::info("config update for {}: id {}, mode {}, hidden_state {}", bar_.bar_id, config.id,
|
||||
config.mode, config.hidden_state);
|
||||
bar_config_ = config;
|
||||
update();
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "modules/sway/ipc/client.hpp"
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
namespace waybar::modules::sway {
|
||||
@ -35,8 +36,8 @@ const std::string Ipc::getSocketPath() const {
|
||||
std::string str;
|
||||
{
|
||||
std::string str_buf;
|
||||
FILE* in;
|
||||
char buf[512] = {0};
|
||||
FILE* in;
|
||||
char buf[512] = {0};
|
||||
if ((in = popen("sway --get-socketpath 2>/dev/null", "r")) == nullptr) {
|
||||
throw std::runtime_error("Failed to get socket path");
|
||||
}
|
||||
@ -76,7 +77,7 @@ int Ipc::open(const std::string& socketPath) const {
|
||||
struct Ipc::ipc_response Ipc::recv(int fd) {
|
||||
std::string header;
|
||||
header.resize(ipc_header_size_);
|
||||
auto data32 = reinterpret_cast<uint32_t*>(header.data() + ipc_magic_.size());
|
||||
auto data32 = reinterpret_cast<uint32_t*>(header.data() + ipc_magic_.size());
|
||||
size_t total = 0;
|
||||
|
||||
while (total < ipc_header_size_) {
|
||||
|
@ -51,8 +51,8 @@ void Language::onCmd(const struct Ipc::ipc_response& res) {
|
||||
|
||||
try {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto payload = parser_.parse(res.payload);
|
||||
std::vector<std::string> used_layouts;
|
||||
auto payload = parser_.parse(res.payload);
|
||||
std::vector<std::string> used_layouts;
|
||||
// Display current layout of a device with a maximum count of layouts, expecting that all will
|
||||
// be OK
|
||||
Json::ArrayIndex max_id = 0, max = 0;
|
||||
@ -83,7 +83,7 @@ void Language::onEvent(const struct Ipc::ipc_response& res) {
|
||||
|
||||
try {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto payload = parser_.parse(res.payload)["input"];
|
||||
auto payload = parser_.parse(res.payload)["input"];
|
||||
if (payload["type"].asString() == "keyboard") {
|
||||
set_current_layout(payload[XKB_ACTIVE_LAYOUT_NAME_KEY].asString());
|
||||
}
|
||||
@ -95,21 +95,18 @@ void Language::onEvent(const struct Ipc::ipc_response& res) {
|
||||
|
||||
auto Language::update() -> void {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto display_layout = trim(fmt::format(format_,
|
||||
fmt::arg("short", layout_.short_name),
|
||||
fmt::arg("shortDescription", layout_.short_description),
|
||||
fmt::arg("long", layout_.full_name),
|
||||
fmt::arg("variant", layout_.variant),
|
||||
fmt::arg("flag", layout_.country_flag())));
|
||||
auto display_layout = trim(fmt::format(
|
||||
format_, fmt::arg("short", layout_.short_name),
|
||||
fmt::arg("shortDescription", layout_.short_description), fmt::arg("long", layout_.full_name),
|
||||
fmt::arg("variant", layout_.variant), fmt::arg("flag", layout_.country_flag())));
|
||||
label_.set_markup(display_layout);
|
||||
if (tooltipEnabled()) {
|
||||
if (tooltip_format_ != "") {
|
||||
auto tooltip_display_layout = trim(fmt::format(tooltip_format_,
|
||||
fmt::arg("short", layout_.short_name),
|
||||
fmt::arg("shortDescription", layout_.short_description),
|
||||
fmt::arg("long", layout_.full_name),
|
||||
fmt::arg("variant", layout_.variant),
|
||||
fmt::arg("flag", layout_.country_flag())));
|
||||
auto tooltip_display_layout = trim(
|
||||
fmt::format(tooltip_format_, fmt::arg("short", layout_.short_name),
|
||||
fmt::arg("shortDescription", layout_.short_description),
|
||||
fmt::arg("long", layout_.full_name), fmt::arg("variant", layout_.variant),
|
||||
fmt::arg("flag", layout_.country_flag())));
|
||||
label_.set_tooltip_markup(tooltip_display_layout);
|
||||
} else {
|
||||
label_.set_tooltip_markup(display_layout);
|
||||
@ -129,7 +126,7 @@ auto Language::set_current_layout(std::string current_layout) -> void {
|
||||
auto Language::init_layouts_map(const std::vector<std::string>& used_layouts) -> void {
|
||||
std::map<std::string, std::vector<Layout*>> found_by_short_names;
|
||||
XKBContext xkb_context;
|
||||
auto layout = xkb_context.next_layout();
|
||||
auto layout = xkb_context.next_layout();
|
||||
for (; layout != nullptr; layout = xkb_context.next_layout()) {
|
||||
if (std::find(used_layouts.begin(), used_layouts.end(), layout->full_name) ==
|
||||
used_layouts.end()) {
|
||||
@ -155,8 +152,7 @@ auto Language::init_layouts_map(const std::vector<std::string>& used_layouts) ->
|
||||
std::map<std::string, int> short_name_to_number_map;
|
||||
for (const auto& used_layout_name : used_layouts) {
|
||||
auto found = layouts_map_.find(used_layout_name);
|
||||
if (found == layouts_map_.end())
|
||||
continue;
|
||||
if (found == layouts_map_.end()) continue;
|
||||
auto used_layout = &found->second;
|
||||
auto layouts_with_same_name_list = found_by_short_names[used_layout->short_name];
|
||||
if (layouts_with_same_name_list.size() < 2) {
|
||||
@ -169,10 +165,8 @@ auto Language::init_layouts_map(const std::vector<std::string>& used_layouts) ->
|
||||
|
||||
if (displayed_short_flag != static_cast<std::byte>(0)) {
|
||||
int& number = short_name_to_number_map[used_layout->short_name];
|
||||
used_layout->short_name =
|
||||
used_layout->short_name + std::to_string(number);
|
||||
used_layout->short_description =
|
||||
used_layout->short_description + std::to_string(number);
|
||||
used_layout->short_name = used_layout->short_name + std::to_string(number);
|
||||
used_layout->short_description = used_layout->short_description + std::to_string(number);
|
||||
++number;
|
||||
}
|
||||
}
|
||||
@ -194,18 +188,19 @@ auto Language::XKBContext::next_layout() -> Layout* {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto description = std::string(rxkb_layout_get_description(xkb_layout_));
|
||||
auto name = std::string(rxkb_layout_get_name(xkb_layout_));
|
||||
auto variant_ = rxkb_layout_get_variant(xkb_layout_);
|
||||
auto description = std::string(rxkb_layout_get_description(xkb_layout_));
|
||||
auto name = std::string(rxkb_layout_get_name(xkb_layout_));
|
||||
auto variant_ = rxkb_layout_get_variant(xkb_layout_);
|
||||
std::string variant = variant_ == nullptr ? "" : std::string(variant_);
|
||||
auto short_description_ = rxkb_layout_get_brief(xkb_layout_);
|
||||
auto short_description_ = rxkb_layout_get_brief(xkb_layout_);
|
||||
std::string short_description;
|
||||
if (short_description_ != nullptr) {
|
||||
short_description = std::string(short_description_);
|
||||
base_layouts_by_name_.emplace(name, xkb_layout_);
|
||||
} else {
|
||||
auto base_layout = base_layouts_by_name_[name];
|
||||
short_description = base_layout == nullptr ? "" : std::string(rxkb_layout_get_brief(base_layout));
|
||||
short_description =
|
||||
base_layout == nullptr ? "" : std::string(rxkb_layout_get_brief(base_layout));
|
||||
}
|
||||
delete layout_;
|
||||
layout_ = new Layout{description, name, variant, short_description};
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "modules/sway/mode.hpp"
|
||||
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
namespace waybar::modules::sway {
|
||||
@ -21,7 +22,7 @@ Mode::Mode(const std::string& id, const Json::Value& config)
|
||||
void Mode::onEvent(const struct Ipc::ipc_response& res) {
|
||||
try {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto payload = parser_.parse(res.payload);
|
||||
auto payload = parser_.parse(res.payload);
|
||||
if (payload["change"] != "default") {
|
||||
if (payload["pango_markup"].asBool()) {
|
||||
mode_ = payload["change"].asString();
|
||||
|
@ -70,11 +70,11 @@ std::optional<Glib::ustring> getIconName(const std::string& app_id) {
|
||||
}
|
||||
return icon_name;
|
||||
} catch (Glib::FileError& error) {
|
||||
spdlog::warn(
|
||||
"Error while loading desktop file {}: {}", desktop_file_path.value(), error.what().c_str());
|
||||
spdlog::warn("Error while loading desktop file {}: {}", desktop_file_path.value(),
|
||||
error.what().c_str());
|
||||
} catch (Glib::KeyFileError& error) {
|
||||
spdlog::warn(
|
||||
"Error while loading desktop file {}: {}", desktop_file_path.value(), error.what().c_str());
|
||||
spdlog::warn("Error while loading desktop file {}: {}", desktop_file_path.value(),
|
||||
error.what().c_str());
|
||||
}
|
||||
return {};
|
||||
}
|
||||
@ -114,8 +114,8 @@ auto Window::update() -> void {
|
||||
bar_.window.get_style_context()->remove_class("solo");
|
||||
bar_.window.get_style_context()->remove_class("empty");
|
||||
}
|
||||
label_.set_markup(fmt::format(format_, fmt::arg("title", rewriteTitle(window_)),
|
||||
fmt::arg("app_id", app_id_)));
|
||||
label_.set_markup(
|
||||
fmt::format(format_, fmt::arg("title", rewriteTitle(window_)), fmt::arg("app_id", app_id_)));
|
||||
if (tooltipEnabled()) {
|
||||
label_.set_tooltip_text(window_);
|
||||
}
|
||||
@ -126,28 +126,26 @@ auto Window::update() -> void {
|
||||
int leafNodesInWorkspace(const Json::Value& node) {
|
||||
auto const& nodes = node["nodes"];
|
||||
auto const& floating_nodes = node["floating_nodes"];
|
||||
if(nodes.empty() && floating_nodes.empty()) {
|
||||
if(node["type"] == "workspace")
|
||||
if (nodes.empty() && floating_nodes.empty()) {
|
||||
if (node["type"] == "workspace")
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
int sum = 0;
|
||||
if (!nodes.empty()) {
|
||||
for(auto const& node : nodes)
|
||||
sum += leafNodesInWorkspace(node);
|
||||
for (auto const& node : nodes) sum += leafNodesInWorkspace(node);
|
||||
}
|
||||
if (!floating_nodes.empty()) {
|
||||
for(auto const& node : floating_nodes)
|
||||
sum += leafNodesInWorkspace(node);
|
||||
for (auto const& node : floating_nodes) sum += leafNodesInWorkspace(node);
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
std::tuple<std::size_t, int, std::string, std::string> gfnWithWorkspace(
|
||||
const Json::Value& nodes, std::string& output, const Json::Value& config_,
|
||||
const Bar& bar_, Json::Value& parentWorkspace) {
|
||||
for(auto const& node : nodes) {
|
||||
const Json::Value& nodes, std::string& output, const Json::Value& config_, const Bar& bar_,
|
||||
Json::Value& parentWorkspace) {
|
||||
for (auto const& node : nodes) {
|
||||
if (node["output"].isString()) {
|
||||
output = node["output"].asString();
|
||||
}
|
||||
@ -156,25 +154,22 @@ std::tuple<std::size_t, int, std::string, std::string> gfnWithWorkspace(
|
||||
if ((!config_["all-outputs"].asBool() && output == bar_.output->name) ||
|
||||
config_["all-outputs"].asBool()) {
|
||||
auto app_id = node["app_id"].isString() ? node["app_id"].asString()
|
||||
: node["window_properties"]["instance"].asString();
|
||||
: node["window_properties"]["instance"].asString();
|
||||
int nb = node.size();
|
||||
if(parentWorkspace != 0)
|
||||
nb = leafNodesInWorkspace(parentWorkspace);
|
||||
return {nb,
|
||||
node["id"].asInt(),
|
||||
Glib::Markup::escape_text(node["name"].asString()),
|
||||
app_id};
|
||||
if (parentWorkspace != 0) nb = leafNodesInWorkspace(parentWorkspace);
|
||||
return {nb, node["id"].asInt(), Glib::Markup::escape_text(node["name"].asString()), app_id};
|
||||
}
|
||||
}
|
||||
// iterate
|
||||
if(node["type"] == "workspace")
|
||||
parentWorkspace = node;
|
||||
auto [nb, id, name, app_id] = gfnWithWorkspace(node["nodes"], output, config_, bar_, parentWorkspace);
|
||||
if (node["type"] == "workspace") parentWorkspace = node;
|
||||
auto [nb, id, name, app_id] =
|
||||
gfnWithWorkspace(node["nodes"], output, config_, bar_, parentWorkspace);
|
||||
if (id > -1 && !name.empty()) {
|
||||
return {nb, id, name, app_id};
|
||||
}
|
||||
// Search for floating node
|
||||
std::tie(nb, id, name, app_id) = gfnWithWorkspace(node["floating_nodes"], output, config_, bar_, parentWorkspace);
|
||||
std::tie(nb, id, name, app_id) =
|
||||
gfnWithWorkspace(node["floating_nodes"], output, config_, bar_, parentWorkspace);
|
||||
if (id > -1 && !name.empty()) {
|
||||
return {nb, id, name, app_id};
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ namespace waybar::modules::sway {
|
||||
int Workspaces::convertWorkspaceNameToNum(std::string name) {
|
||||
if (isdigit(name[0])) {
|
||||
errno = 0;
|
||||
char * endptr = NULL;
|
||||
char *endptr = NULL;
|
||||
long long parsed_num = strtoll(name.c_str(), &endptr, 10);
|
||||
if (errno != 0 || parsed_num > INT32_MAX || parsed_num < 0 || endptr == name.c_str()) {
|
||||
return -1;
|
||||
@ -65,11 +65,9 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
|
||||
try {
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto payload = parser_.parse(res.payload);
|
||||
auto payload = parser_.parse(res.payload);
|
||||
workspaces_.clear();
|
||||
std::copy_if(payload.begin(),
|
||||
payload.end(),
|
||||
std::back_inserter(workspaces_),
|
||||
std::copy_if(payload.begin(), payload.end(), std::back_inserter(workspaces_),
|
||||
[&](const auto &workspace) {
|
||||
return !config_["all-outputs"].asBool()
|
||||
? workspace["output"].asString() == bar_.output->name
|
||||
@ -78,12 +76,12 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
|
||||
|
||||
// adding persistent workspaces (as per the config file)
|
||||
if (config_["persistent_workspaces"].isObject()) {
|
||||
const Json::Value & p_workspaces = config_["persistent_workspaces"];
|
||||
const Json::Value &p_workspaces = config_["persistent_workspaces"];
|
||||
const std::vector<std::string> p_workspaces_names = p_workspaces.getMemberNames();
|
||||
|
||||
for (const std::string &p_w_name : p_workspaces_names) {
|
||||
const Json::Value &p_w = p_workspaces[p_w_name];
|
||||
auto it =
|
||||
auto it =
|
||||
std::find_if(payload.begin(), payload.end(), [&p_w_name](const Json::Value &node) {
|
||||
return node["name"].asString() == p_w_name;
|
||||
});
|
||||
@ -133,10 +131,10 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
|
||||
// unnumbered workspaces behind numbered ones when computing the sort
|
||||
// attribute.
|
||||
int max_num = -1;
|
||||
for (auto & workspace : workspaces_) {
|
||||
for (auto &workspace : workspaces_) {
|
||||
max_num = std::max(workspace["num"].asInt(), max_num);
|
||||
}
|
||||
for (auto & workspace : workspaces_) {
|
||||
for (auto &workspace : workspaces_) {
|
||||
auto workspace_num = workspace["num"].asInt();
|
||||
if (workspace_num > -1) {
|
||||
workspace["sort"] = workspace_num;
|
||||
@ -144,13 +142,12 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
|
||||
workspace["sort"] = ++max_num;
|
||||
}
|
||||
}
|
||||
std::sort(workspaces_.begin(),
|
||||
workspaces_.end(),
|
||||
std::sort(workspaces_.begin(), workspaces_.end(),
|
||||
[](const Json::Value &lhs, const Json::Value &rhs) {
|
||||
auto lname = lhs["name"].asString();
|
||||
auto rname = rhs["name"].asString();
|
||||
int l = lhs["sort"].asInt();
|
||||
int r = rhs["sort"].asInt();
|
||||
int l = lhs["sort"].asInt();
|
||||
int r = rhs["sort"].asInt();
|
||||
|
||||
if (l == r) {
|
||||
// In case both integers are the same, lexicographical
|
||||
@ -161,7 +158,6 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
|
||||
|
||||
return l < r;
|
||||
});
|
||||
|
||||
}
|
||||
dp.emit();
|
||||
} catch (const std::exception &e) {
|
||||
@ -173,9 +169,8 @@ void Workspaces::onCmd(const struct Ipc::ipc_response &res) {
|
||||
bool Workspaces::filterButtons() {
|
||||
bool needReorder = false;
|
||||
for (auto it = buttons_.begin(); it != buttons_.end();) {
|
||||
auto ws = std::find_if(workspaces_.begin(), workspaces_.end(), [it](const auto &node) {
|
||||
return node["name"].asString() == it->first;
|
||||
});
|
||||
auto ws = std::find_if(workspaces_.begin(), workspaces_.end(),
|
||||
[it](const auto &node) { return node["name"].asString() == it->first; });
|
||||
if (ws == workspaces_.end() ||
|
||||
(!config_["all-outputs"].asBool() && (*ws)["output"].asString() != bar_.output->name)) {
|
||||
it = buttons_.erase(it);
|
||||
@ -189,7 +184,7 @@ bool Workspaces::filterButtons() {
|
||||
|
||||
auto Workspaces::update() -> void {
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
bool needReorder = filterButtons();
|
||||
bool needReorder = filterButtons();
|
||||
for (auto it = workspaces_.begin(); it != workspaces_.end(); ++it) {
|
||||
auto bit = buttons_.find((*it)["name"].asString());
|
||||
if (bit == buttons_.end()) {
|
||||
@ -231,10 +226,8 @@ 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)),
|
||||
fmt::arg("value", output),
|
||||
fmt::arg("name", trimWorkspaceName(output)),
|
||||
output = fmt::format(format, fmt::arg("icon", getIcon(output, *it)),
|
||||
fmt::arg("value", output), fmt::arg("name", trimWorkspaceName(output)),
|
||||
fmt::arg("index", (*it)["num"].asString()));
|
||||
}
|
||||
if (!config_["disable-markup"].asBool()) {
|
||||
@ -249,7 +242,7 @@ auto Workspaces::update() -> void {
|
||||
}
|
||||
|
||||
Gtk::Button &Workspaces::addButton(const Json::Value &node) {
|
||||
auto pair = buttons_.emplace(node["name"].asString(), node["name"].asString());
|
||||
auto pair = buttons_.emplace(node["name"].asString(), node["name"].asString());
|
||||
auto &&button = pair.first->second;
|
||||
box_.pack_start(button, false, false, 0);
|
||||
button.set_name("sway-workspace-" + node["name"].asString());
|
||||
@ -258,22 +251,18 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) {
|
||||
button.signal_pressed().connect([this, 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()));
|
||||
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()));
|
||||
} else {
|
||||
ipc_.sendCmd(
|
||||
IPC_COMMAND,
|
||||
fmt::format("workspace {} \"{}\"",
|
||||
config_["disable-auto-back-and-forth"].asBool()
|
||||
? "--no-auto-back-and-forth"
|
||||
: "",
|
||||
node["name"].asString()));
|
||||
ipc_.sendCmd(IPC_COMMAND, fmt::format("workspace {} \"{}\"",
|
||||
config_["disable-auto-back-and-forth"].asBool()
|
||||
? "--no-auto-back-and-forth"
|
||||
: "",
|
||||
node["name"].asString()));
|
||||
}
|
||||
} catch (const std::exception &e) {
|
||||
spdlog::error("Workspaces: {}", e.what());
|
||||
@ -316,9 +305,8 @@ bool Workspaces::handleScroll(GdkEventScroll *e) {
|
||||
std::string name;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto it = std::find_if(workspaces_.begin(), workspaces_.end(), [](const auto &workspace) {
|
||||
return workspace["focused"].asBool();
|
||||
});
|
||||
auto it = std::find_if(workspaces_.begin(), workspaces_.end(),
|
||||
[](const auto &workspace) { return workspace["focused"].asBool(); });
|
||||
if (it == workspaces_.end()) {
|
||||
return true;
|
||||
}
|
||||
@ -334,9 +322,7 @@ bool Workspaces::handleScroll(GdkEventScroll *e) {
|
||||
}
|
||||
}
|
||||
try {
|
||||
ipc_.sendCmd(
|
||||
IPC_COMMAND,
|
||||
fmt::format(workspace_switch_cmd_, "--no-auto-back-and-forth", name));
|
||||
ipc_.sendCmd(IPC_COMMAND, fmt::format(workspace_switch_cmd_, "--no-auto-back-and-forth", name));
|
||||
} catch (const std::exception &e) {
|
||||
spdlog::error("Workspaces: {}", e.what());
|
||||
}
|
||||
@ -344,7 +330,7 @@ bool Workspaces::handleScroll(GdkEventScroll *e) {
|
||||
}
|
||||
|
||||
const std::string Workspaces::getCycleWorkspace(std::vector<Json::Value>::iterator it,
|
||||
bool prev) const {
|
||||
bool prev) const {
|
||||
if (prev && it == workspaces_.begin() && !config_["disable-scroll-wraparound"].asBool()) {
|
||||
return (*(--workspaces_.end()))["name"].asString();
|
||||
}
|
||||
|
Reference in New Issue
Block a user