Keep Win32 GUI on one OS thread
All checks were successful
build-windows-exe / build (push) Successful in 1m35s
All checks were successful
build-windows-exe / build (push) Successful in 1m35s
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -328,6 +329,9 @@ func guiLog(text string) {
|
||||
}
|
||||
|
||||
func runNativeGUI(initialTab string) error {
|
||||
runtime.LockOSThread()
|
||||
defer runtime.UnlockOSThread()
|
||||
|
||||
user32 := syscall.NewLazyDLL("user32.dll")
|
||||
kernel32 := syscall.NewLazyDLL("kernel32.dll")
|
||||
gdi32 := syscall.NewLazyDLL("gdi32.dll")
|
||||
@@ -990,6 +994,10 @@ func refreshGUI(setWindowText *syscall.LazyProc, app *guiApp, reloadData bool) {
|
||||
if app == nil {
|
||||
return
|
||||
}
|
||||
if app.activeTab == "history" && !reloadData {
|
||||
syncPaneVisibility(app)
|
||||
return
|
||||
}
|
||||
start := time.Now()
|
||||
defer func() {
|
||||
if d := time.Since(start); d > 100*time.Millisecond {
|
||||
|
||||
Reference in New Issue
Block a user