Merge pull request #2247 from gardenappl/hypr-backend
More robust Hyprland backend
This commit is contained in:
commit
238cfa9547
|
@ -181,17 +181,21 @@ std::string IPC::getSocket1Reply(const std::string& rq) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char buffer[8192] = {0};
|
char buffer[8192] = {0};
|
||||||
|
std::string response;
|
||||||
|
|
||||||
|
do {
|
||||||
sizeWritten = read(SERVERSOCKET, buffer, 8192);
|
sizeWritten = read(SERVERSOCKET, buffer, 8192);
|
||||||
|
|
||||||
if (sizeWritten < 0) {
|
if (sizeWritten < 0) {
|
||||||
spdlog::error("Hyprland IPC: Couldn't read (5)");
|
spdlog::error("Hyprland IPC: Couldn't read (5)");
|
||||||
|
close(SERVERSOCKET);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
response.append(buffer, sizeWritten);
|
||||||
|
} while (sizeWritten == 8192);
|
||||||
|
|
||||||
close(SERVERSOCKET);
|
close(SERVERSOCKET);
|
||||||
|
return response;
|
||||||
return std::string(buffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace waybar::modules::hyprland
|
} // namespace waybar::modules::hyprland
|
||||||
|
|
Loading…
Reference in New Issue