summaryrefslogtreecommitdiff
path: root/find.go
diff options
context:
space:
mode:
Diffstat (limited to 'find.go')
-rw-r--r--find.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/find.go b/find.go
index b07f711..274e544 100644
--- a/find.go
+++ b/find.go
@@ -91,6 +91,23 @@ func (tk *guiWidget) findWindows() []*guiWidget {
return found
}
+// find the BG widget.
+// This widget is always in the background and covers the whole screen.
+// gocui seems to not return mouse events unless there is something there
+func (tk *guiWidget) findBG() *guiWidget {
+ if tk.node.WidgetType == widget.Stdout {
+ tk.isBG = true
+ return tk
+ }
+
+ for _, child := range tk.children {
+ if found := child.findBG(); found != nil {
+ return found
+ }
+ }
+ return nil
+}
+
// returns the "highest priority widget under the mouse
func findUnderMouse() *guiWidget {
w, h := me.baseGui.MousePosition()