Fix freeze on decryption

This commit is contained in:
Xpl0itU 2023-08-10 11:45:31 +02:00
parent 0102dabe4b
commit 1f1566e8a0

View file

@ -16,6 +16,8 @@ import "C"
import ( import (
"fmt" "fmt"
"unsafe" "unsafe"
"github.com/gotk3/gotk3/gtk"
) )
//export callProgressCallback //export callProgressCallback
@ -36,6 +38,9 @@ func DecryptContents(path string, progress *ProgressWindow, deleteEncryptedConte
for progressInt := range progressChan { for progressInt := range progressChan {
progress.bar.SetFraction(float64(progressInt) / 100) progress.bar.SetFraction(float64(progressInt) / 100)
for gtk.EventsPending() {
gtk.MainIteration()
}
} }
if err := <-errorChan; err != nil { if err := <-errorChan; err != nil {