From 994449b1c2cae3d21b3395d67c0ec5ffbd37787b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 4 Mar 2025 04:06:36 -0600 Subject: [PATCH] lock for now for gocui --- init.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.go b/init.go index e549b18..291020c 100644 --- a/init.go +++ b/init.go @@ -376,6 +376,7 @@ func refreshGocui() { // artificially pause clock while dragging. // this is a reminder to make this refresh code smarter // after the switch to protocol buffers + me.myTree.Lock() if me.mouse.mouseUp { // log.Info("refresh now on mouseUp") // todo: add logic here to see if the application has changed anything @@ -387,6 +388,7 @@ func refreshGocui() { lastRefresh = time.Now() } } + me.myTree.Unlock() } } } @@ -402,6 +404,7 @@ func newWindowTrigger() { // log.Log(NOW, "newWindowTrigger() got new window", tk.cuiName) // time.Sleep(200 * time.Millisecond) waitOK() + me.myTree.Lock() // time.Sleep(200 * time.Millisecond) redoWindows(me.FirstWindowW, me.FirstWindowH) me.firstWindowOk = true @@ -414,6 +417,7 @@ func newWindowTrigger() { me.textbox.tk.prepTextbox() } tk.makeWindowActive() + me.myTree.Unlock() } } }