mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
More robust Hyprland backend
This commit is contained in:
parent
d367b7e1d6
commit
b163b21ace
@ -181,17 +181,21 @@ std::string IPC::getSocket1Reply(const std::string& rq) {
|
||||
}
|
||||
|
||||
char buffer[8192] = {0};
|
||||
std::string response;
|
||||
|
||||
sizeWritten = read(SERVERSOCKET, buffer, 8192);
|
||||
do {
|
||||
sizeWritten = read(SERVERSOCKET, buffer, 8192);
|
||||
|
||||
if (sizeWritten < 0) {
|
||||
spdlog::error("Hyprland IPC: Couldn't read (5)");
|
||||
return "";
|
||||
}
|
||||
if (sizeWritten < 0) {
|
||||
spdlog::error("Hyprland IPC: Couldn't read (5)");
|
||||
close(SERVERSOCKET);
|
||||
return "";
|
||||
}
|
||||
response.append(buffer, sizeWritten);
|
||||
} while (sizeWritten == 8192);
|
||||
|
||||
close(SERVERSOCKET);
|
||||
|
||||
return std::string(buffer);
|
||||
return response;
|
||||
}
|
||||
|
||||
} // namespace waybar::modules::hyprland
|
||||
|
Loading…
Reference in New Issue
Block a user