aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/aerc.go3
-rw-r--r--widgets/terminal.go20
2 files changed, 11 insertions, 12 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index e210916f..7ba1ea4e 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -348,9 +348,6 @@ func (aerc *Aerc) Event(event tcell.Event) bool {
return false
}
case *tcell.EventMouse:
- if event.Buttons() == tcell.ButtonNone {
- return false
- }
x, y := event.Position()
aerc.grid.MouseEvent(x, y, event)
return true
diff --git a/widgets/terminal.go b/widgets/terminal.go
index c8b97d3a..f0d9dc96 100644
--- a/widgets/terminal.go
+++ b/widgets/terminal.go
@@ -140,16 +140,18 @@ func (term *Terminal) draw() {
}
func (term *Terminal) MouseEvent(localX int, localY int, event tcell.Event) {
- if event, ok := event.(*tcell.EventMouse); ok {
- if term.OnEvent != nil {
- if term.OnEvent(event) {
- return
- }
- }
- if term.closed {
- return
- }
+ ev, ok := event.(*tcell.EventMouse)
+ if !ok {
+ return
+ }
+ if term.OnEvent != nil {
+ term.OnEvent(ev)
+ }
+ if term.closed {
+ return
}
+ e := tcell.NewEventMouse(localX, localY, ev.Buttons(), ev.Modifiers())
+ term.vterm.HandleEvent(e)
}
func (term *Terminal) Focus(focus bool) {