diff --git a/init.go b/init.go index 03409c3..58d2ad2 100644 --- a/init.go +++ b/init.go @@ -204,6 +204,10 @@ func newWindowTrigger() { log.Log(NOW, "newWindowTrigger() got new window", a) time.Sleep(200 * time.Millisecond) redoWindows(1, -1) + if !me.stdout.init { + me.stdout.init = true + relocateStdoutOffscreen() + } log.Log(NOW, "newWindowTrigger() after sleep") } } diff --git a/stdoutShow.go b/stdoutShow.go index dd5a403..752f0ed 100644 --- a/stdoutShow.go +++ b/stdoutShow.go @@ -96,6 +96,9 @@ func makeOutputWidget(g *gocui.Gui, stringFromMouseClick string) *gocui.View { } func relocateStdoutOffscreen() { + if me.stdout.tk == nil { + return + } newW := 10 newH := 0 - me.stdout.h - 4 me.stdout.tk.relocateStdout(newW, newH) diff --git a/structs.go b/structs.go index 6cd9b30..9deb246 100644 --- a/structs.go +++ b/structs.go @@ -79,10 +79,11 @@ type stdout struct { outputOffscreen bool // is the STDOUT window offscreen? // offscreenW int // where to place the window offscreen // offscreenH int // where to place the window offscreen - lastW int // the last 'w' location (used to move from offscreen to onscreen) - lastH int // the last 'h' location (used to move from offscreen to onscreen) - mouseOffsetW int // the current 'w' offset - mouseOffsetH int // the current 'h' offset + lastW int // the last 'w' location (used to move from offscreen to onscreen) + lastH int // the last 'h' location (used to move from offscreen to onscreen) + mouseOffsetW int // the current 'w' offset + mouseOffsetH int // the current 'h' offset + init bool // moves the window offscreen on startup } // this is the gocui way