stdout window hides on startup

This commit is contained in:
Jeff Carr 2025-02-06 03:33:27 -06:00
parent 9c548faeda
commit 96cb52f3ef
3 changed files with 12 additions and 4 deletions

View File

@ -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")
}
}

View File

@ -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)

View File

@ -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