Fix global hotkeys not working when connecting input after startup

This commit is contained in:
dec05eba
2024-11-25 18:16:21 +01:00
parent 9467abb0a2
commit ef7eb26ea5
2 changed files with 50 additions and 25 deletions

View File

@@ -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() {