diff options
| -rw-r--r-- | init.go | 4 | ||||
| -rw-r--r-- | stdoutShow.go | 3 | ||||
| -rw-r--r-- | structs.go | 9 |
3 files changed, 12 insertions, 4 deletions
@@ -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) @@ -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 |
