init was the problem for window placement

This commit is contained in:
Jeff Carr 2025-02-06 22:17:05 -06:00
parent 3d104d5b4a
commit 16886945ed
4 changed files with 9 additions and 5 deletions

View File

@ -141,10 +141,11 @@ func tabCycleWindows(g *gocui.Gui, v *gocui.View) error {
return nil
}
tk.makeWindowActive()
w, h := g.MousePosition()
me.downW = w
me.downH = h
tk.doWindowClick()
// w, h := g.MousePosition()
// me.downW = tk.gocuiSize.w0
// me.downH = tk.gocuiSize.h0
tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0)
setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn
return nil
}

View File

@ -42,6 +42,7 @@ func mouseMove(g *gocui.Gui) {
// don't move this code out of here
var found bool = false
if me.currentDrag != nil {
me.currentDrag.dumpWidget(fmt.Sprintf("MM (%3d,%3d)", w, h))
me.currentDrag.moveNew()
return
}

View File

@ -209,7 +209,7 @@ func newWindowTrigger() {
relocateStdoutOffscreen()
}
tk.makeWindowActive()
tk.doWidgetClick(tk.gocuiSize.w0, tk.gocuiSize.h0)
tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0)
setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn
log.Log(NOW, "newWindowTrigger() after sleep")
}

View File

@ -15,6 +15,7 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
if tk.node.WidgetType != widget.Window {
return
}
tk.dumpWidget(fmt.Sprintf("redrawWindow(%d,%d)", w, h))
if tk.full.Height() > 40 {
tk.window.dense = true
}
@ -97,6 +98,7 @@ func redoWindows(nextW int, nextH int) {
if tk.window.wasDragged {
// don't move windows around the user has dragged to a certain location
tk.redrawWindow(tk.gocuiSize.w0, tk.gocuiSize.h0)
setThingsOnTop() // sets help, Stdout, etc on the top after windows have been redrawn
} else {
w, _ := me.baseGui.Size()
if nextW > w-20 {