diff options
Diffstat (limited to 'eventMouseMove.go')
| -rw-r--r-- | eventMouseMove.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/eventMouseMove.go b/eventMouseMove.go index a88fa79..980612f 100644 --- a/eventMouseMove.go +++ b/eventMouseMove.go @@ -19,8 +19,6 @@ import ( "go.wit.com/widget" ) -var currentDrag *guiWidget - // this function uses the mouse position to highlight & unhighlight things // this is run every time the user moves the mouse over the terminal window func mouseMove(g *gocui.Gui) { @@ -43,19 +41,19 @@ func mouseMove(g *gocui.Gui) { // plugin will segfault if you don't keep this inside a check for msgMouseDown // don't move this code out of here var found bool = false - if currentDrag != nil { - currentDrag.moveNew() + if me.currentDrag != nil { + me.currentDrag.moveNew() return } // new function that is smarter if tk := findWindowUnderMouse(); tk != nil { - currentDrag = tk + me.currentDrag = tk return } // first look for windows for _, tk := range findByXY(w, h) { if tk.node.WidgetType == widget.Window { - currentDrag = tk + me.currentDrag = tk return } } @@ -63,20 +61,20 @@ func mouseMove(g *gocui.Gui) { // now look for the STDOUT window for _, tk := range findByXY(w, h) { if tk.node.WidgetType == widget.Flag { - currentDrag = tk + me.currentDrag = tk // tk.moveNew() return } } for _, tk := range findByXY(w, h) { if tk.node.WidgetType == widget.Stdout { - currentDrag = tk + me.currentDrag = tk // tk.moveNew() return } /* if tk.node.WidgetType == widget.Label { - currentDrag = tk + me.currentDrag = tk // tk.moveNew() return } |
