summaryrefslogtreecommitdiff
path: root/eventMouseDrag.go
diff options
context:
space:
mode:
Diffstat (limited to 'eventMouseDrag.go')
-rw-r--r--eventMouseDrag.go65
1 files changed, 30 insertions, 35 deletions
diff --git a/eventMouseDrag.go b/eventMouseDrag.go
index ce66257..c2625e1 100644
--- a/eventMouseDrag.go
+++ b/eventMouseDrag.go
@@ -84,54 +84,49 @@ func mouseMove(g *gocui.Gui) {
return
}
- // if me.mouse.globalMouseDown {
- // log.Info("msgMouseDown == true")
- // 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
+ // drag whatever was set to drag
if me.mouse.currentDrag != nil {
// me.mouse.currentDrag.dumpWidget(fmt.Sprintf("MM (%3d,%3d)", w, h))
me.mouse.currentDrag.moveNew()
return
}
- // new function that is smarter
- if tk := findWindowUnderMouse(); tk != nil {
- tk.setAsDragging()
- return
- }
- // first look for windows
- for _, tk := range findByXY(w, h) {
- if tk.node.WidgetType == widget.Window {
- tk.setAsDragging()
- return
- }
- }
+ log.Info(fmt.Sprintf("gui toolkit error. nothing to drag at (%d,%d)", w, h))
+ return
- // now look for the STDOUT window
- for _, tk := range findByXY(w, h) {
- if tk.node.WidgetType == widget.Flag {
+ // if me.mouse.globalMouseDown {
+ // log.Info("msgMouseDown == true")
+ // plugin will segfault if you don't keep this inside a check for msgMouseDown
+ // don't move this code out of here
+ /*
+ // new function that is smarter
+ if tk := findWindowUnderMouse(); tk != nil {
tk.setAsDragging()
return
}
- }
- for _, tk := range findByXY(w, h) {
- if tk.node.WidgetType == widget.Stdout {
- tk.setAsDragging()
- // tk.moveNew()
- return
+ // first look for windows
+ for _, tk := range findByXY(w, h) {
+ if tk.node.WidgetType == widget.Window {
+ tk.setAsDragging()
+ return
+ }
}
- /*
- if tk.node.WidgetType == widget.Label {
- me.mouse.currentDrag = tk
+
+ // now look for the STDOUT window
+ for _, tk := range findByXY(w, h) {
+ if tk.node.WidgetType == widget.Flag {
+ tk.setAsDragging()
+ return
+ }
+ }
+ for _, tk := range findByXY(w, h) {
+ if tk.node.WidgetType == widget.Stdout {
+ tk.setAsDragging()
// tk.moveNew()
return
}
- */
- found = true
- }
- if !found {
- log.Info(fmt.Sprintf("findByXY() empty. nothing to move at (%d,%d)", w, h))
- }
+ found = true
+ }
+ */
}
func (tk *guiWidget) setAsDragging() {