Skip to content

Commit 42a17e1

Browse files
committed
Minor fixes
- Add missing CSS class to manpage - Fix rare segfault when address is not found (seems to only happen when compiled for production)
1 parent bfcec8e commit 42a17e1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

man/waybar-hyprland-workspaces.5.scd

+1
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,4 @@ Additional to workspace name matching, the following *format-icons* can be set.
210210
- *#workspaces button.special*
211211
- *#workspaces button.urgent*
212212
- *#workspaces button.hosting-monitor* (gets applied if workspace-monitor == waybar-monitor)
213+
- *#workspaces .taskbar-window* (each window in the taskbar)

src/modules/hyprland/workspaces.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -548,12 +548,11 @@ void Workspaces::onWindowTitleEvent(std::string const &payload) {
548548
Json::Value clientsData = gIPC->getSocket1JsonReply("clients");
549549
std::string jsonWindowAddress = fmt::format("0x{}", payload);
550550

551-
auto client =
552-
std::find_if(clientsData.begin(), clientsData.end(), [jsonWindowAddress](auto &client) {
553-
return client["address"].asString() == jsonWindowAddress;
554-
});
551+
auto client = std::ranges::find_if(clientsData, [&jsonWindowAddress](auto &c) {
552+
return c["address"].asString() == jsonWindowAddress;
553+
});
555554

556-
if (!client->empty()) {
555+
if (client != clientsData.end() && !client->empty()) {
557556
(*inserter)({*client});
558557
}
559558
}

0 commit comments

Comments
 (0)