From ef7eb26ea5ff807258cf504ee9b66435b0d680f4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 25 Nov 2024 18:16:21 +0100 Subject: Fix global hotkeys not working when connecting input after startup --- src/GlobalHotkeysLinux.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/GlobalHotkeysLinux.cpp') 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() { -- cgit v1.2.3