fix: streamline hotkey listener initialization and improve error handling for Linux

This commit is contained in:
jahruz67
2026-05-19 17:42:13 -07:00
parent b6ae530876
commit 00f4912cc3
3 changed files with 15 additions and 22 deletions
+5 -1
View File
@@ -170,7 +170,11 @@ func (l *Listener) eventLoop(hk *xhk.Hotkey) {
case <-time.After(20 * time.Millisecond):
// Genuine second press. Toggle off.
logger.Info("Shortcut activated again: toggling recording (Wayland toggle fallback)")
go l.startCallback()
if l.stopCallback != nil {
go l.stopCallback()
} else {
go l.startCallback()
}
isRecording = false
}
}