summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eventMouse.go9
-rw-r--r--eventMouseMove.go5
2 files changed, 10 insertions, 4 deletions
diff --git a/eventMouse.go b/eventMouse.go
index c4871ec..eb89978 100644
--- a/eventMouse.go
+++ b/eventMouse.go
@@ -43,14 +43,15 @@ func mouseDown(g *gocui.Gui, v *gocui.View) error {
w, h := g.MousePosition()
log.Info("mouseDown() stopping here. dropdwon menu is in effect")
for _, tk := range findByXY(w, h) {
- if tk.node.WidgetType == widget.Flag {
- log.Info("SENDING CLICK TO Dropdown Flag")
+ if (tk.node.WidgetType == widget.Flag) && (tk == me.dropdown.tk) {
+ log.Info("SENDING CLICK TO Flag (dropdown)")
tk.doWidgetClick(w, h)
+ me.dropdown.active = false
return nil
}
}
- log.Info("never found dropdown")
- me.dropdown.active = false
+ log.Info("never found dropdown at", w, h)
+ // me.dropdown.active = false
return nil
}
diff --git a/eventMouseMove.go b/eventMouseMove.go
index 5fe98d3..eb6beed 100644
--- a/eventMouseMove.go
+++ b/eventMouseMove.go
@@ -33,6 +33,11 @@ func mouseMove(g *gocui.Gui) {
}
}
+ if me.globalMouseDown && me.dropdown.active {
+ log.Info("can't drag while dropdown is active", w, h)
+ return
+ }
+
if me.globalMouseDown {
// log.Info("msgMouseDown == true")
// plugin will segfault if you don't keep this inside a check for msgMouseDown