Skip to content

Commit

Permalink
Merge pull request #3695 from cfillion/fix-hyprland-crashes
Browse files Browse the repository at this point in the history
Fix a crash after handling SIGINT and a data race when initializing the Hyprland workspace modules
  • Loading branch information
Alexays authored Oct 21, 2024
2 parents 280f11e + 92242f0 commit dacecb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ int main(int argc, char* argv[]) {
ret = client->main(argc, argv);
} while (reload);

std::signal(SIGUSR1, SIG_IGN);
std::signal(SIGUSR2, SIG_IGN);
std::signal(SIGINT, SIG_IGN);

delete client;
return ret;
} catch (const std::exception& e) {
Expand Down
3 changes: 3 additions & 0 deletions src/modules/hyprland/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ namespace waybar::modules::hyprland {
std::filesystem::path IPC::socketFolder_;

std::filesystem::path IPC::getSocketFolder(const char* instanceSig) {
static std::mutex folderMutex;
std::unique_lock lock(folderMutex);

// socket path, specified by EventManager of Hyprland
if (!socketFolder_.empty()) {
return socketFolder_;
Expand Down

0 comments on commit dacecb9

Please sign in to comment.