Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
- Add missing CSS class to manpage
- Fix rare segfault when address is not found (seems to only happen when compiled for production)
  • Loading branch information
pol-rivero committed Jan 8, 2025
1 parent bfcec8e commit 42a17e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions man/waybar-hyprland-workspaces.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,4 @@ Additional to workspace name matching, the following *format-icons* can be set.
- *#workspaces button.special*
- *#workspaces button.urgent*
- *#workspaces button.hosting-monitor* (gets applied if workspace-monitor == waybar-monitor)
- *#workspaces .taskbar-window* (each window in the taskbar)
9 changes: 4 additions & 5 deletions src/modules/hyprland/workspaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,12 +548,11 @@ void Workspaces::onWindowTitleEvent(std::string const &payload) {
Json::Value clientsData = gIPC->getSocket1JsonReply("clients");
std::string jsonWindowAddress = fmt::format("0x{}", payload);

auto client =
std::find_if(clientsData.begin(), clientsData.end(), [jsonWindowAddress](auto &client) {
return client["address"].asString() == jsonWindowAddress;
});
auto client = std::ranges::find_if(clientsData, [&jsonWindowAddress](auto &c) {
return c["address"].asString() == jsonWindowAddress;
});

if (!client->empty()) {
if (client != clientsData.end() && !client->empty()) {
(*inserter)({*client});
}
}
Expand Down

0 comments on commit 42a17e1

Please sign in to comment.