From f036fcbc0ff56dbab185d42c40f748e9c097bf22 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 24 Jan 2025 00:42:33 +0100 Subject: Add 'restart replay on save' option --- src/GlobalHotkeysLinux.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/GlobalHotkeysLinux.cpp') diff --git a/src/GlobalHotkeysLinux.cpp b/src/GlobalHotkeysLinux.cpp index c779777..357fb16 100644 --- a/src/GlobalHotkeysLinux.cpp +++ b/src/GlobalHotkeysLinux.cpp @@ -166,6 +166,9 @@ namespace gsr { } bool GlobalHotkeysLinux::bind_key_press(Hotkey hotkey, const std::string &id, GlobalHotkeyCallback callback) { + if(process_id <= 0) + return false; + if(bound_actions_by_id.find(id) != bound_actions_by_id.end()) return false; @@ -202,6 +205,9 @@ namespace gsr { } void GlobalHotkeysLinux::unbind_all_keys() { + if(process_id <= 0) + return; + if(bound_actions_by_id.empty()) return; -- cgit v1.2.3