summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-06 22:17:05 -0600
committerJeff Carr <[email protected]>2025-02-06 22:17:05 -0600
commit16886945edc879548719c10ad9a9a79de83cd75e (patch)
tree958f5fea7d62da172406bd7d15583fb4fc206a35
parent3d104d5b4a61ca4d32956c771f8882a215574515 (diff)
init was the problem for window placement
-rw-r--r--eventBindings.go9
-rw-r--r--eventMouseMove.go1
-rw-r--r--init.go2
-rw-r--r--window.go2
4 files changed, 9 insertions, 5 deletions
diff --git a/eventBindings.go b/eventBindings.go
index d51e061..98e0b1a 100644
--- a/eventBindings.go
+++ b/eventBindings.go
@@ -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
}
diff --git a/eventMouseMove.go b/eventMouseMove.go
index adce6ed..16dee6c 100644
--- a/eventMouseMove.go
+++ b/eventMouseMove.go
@@ -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
}
diff --git a/init.go b/init.go
index 60f3871..8439097 100644
--- a/init.go
+++ b/init.go
@@ -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")
}
diff --git a/window.go b/window.go
index 57950a1..cf3499e 100644
--- a/window.go
+++ b/window.go
@@ -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 {