diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-11-25 18:16:21 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-11-25 18:16:21 +0100 |
commit | ef7eb26ea5ff807258cf504ee9b66435b0d680f4 (patch) | |
tree | c1986810e4988e158e711e820e6792c56015e99b /src/GlobalHotkeysLinux.cpp | |
parent | 9467abb0a25a1277f2744cb1ac30c5b3b6491df3 (diff) |
Fix global hotkeys not working when connecting input after startup
Diffstat (limited to 'src/GlobalHotkeysLinux.cpp')
-rw-r--r-- | src/GlobalHotkeysLinux.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/GlobalHotkeysLinux.cpp b/src/GlobalHotkeysLinux.cpp index 08803d7..b0e8e52 100644 --- a/src/GlobalHotkeysLinux.cpp +++ b/src/GlobalHotkeysLinux.cpp @@ -15,12 +15,6 @@ namespace gsr { } GlobalHotkeysLinux::~GlobalHotkeysLinux() { - if(process_id > 0) { - kill(process_id, SIGKILL); - int status; - waitpid(process_id, &status, 0); - } - for(int i = 0; i < 2; ++i) { if(pipes[i] > 0) close(pipes[i]); @@ -28,6 +22,12 @@ namespace gsr { if(read_file) fclose(read_file); + + if(process_id > 0) { + kill(process_id, SIGKILL); + int status; + waitpid(process_id, &status, 0); + } } bool GlobalHotkeysLinux::start() { |