mirror of
https://github.com/jahruz67/wisp-open.git
synced 2026-08-08 18:14:08 +00:00
fix: adjust sleep durations in Linux input focus release for improved responsiveness
This commit is contained in:
@@ -202,15 +202,15 @@ func (r *AudioRecorder) Stop() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop device capture without uninitializing hardware
|
// Stop and release the capture device so Linux privacy indicators turn off
|
||||||
|
// between recordings. The next Start will initialize it again.
|
||||||
if r.device != nil {
|
if r.device != nil {
|
||||||
if err := r.device.Stop(); err != nil {
|
if err := r.device.Stop(); err != nil {
|
||||||
logger.Error("Failed to stop audio device: %v", err)
|
logger.Error("Failed to stop audio device: %v", err)
|
||||||
// On failure, it might be safer to uninit
|
}
|
||||||
r.device.Uninit()
|
r.device.Uninit()
|
||||||
r.device = nil
|
r.device = nil
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Finalize WAV file
|
// Finalize WAV file
|
||||||
if r.outputFile != nil {
|
if r.outputFile != nil {
|
||||||
|
|||||||
@@ -52,11 +52,11 @@ func (a *App) insertTranscription(text string) {
|
|||||||
|
|
||||||
func (a *App) releaseLinuxInputFocus() {
|
func (a *App) releaseLinuxInputFocus() {
|
||||||
if a.ctx == nil {
|
if a.ctx == nil {
|
||||||
time.Sleep(150 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
wailsruntime.WindowHide(a.ctx)
|
wailsruntime.WindowHide(a.ctx)
|
||||||
time.Sleep(250 * time.Millisecond)
|
time.Sleep(150 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
func isASCII(text string) bool {
|
func isASCII(text string) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user