From ee604535eaff54d58f45f049ebc1f7ec3f51abc0 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Tue, 6 Dec 2016 02:38:01 +0100 Subject: [PATCH] Fix middle mouse button not passed to tmux --- terminatorlib/terminal.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 0bce7e2d..0ee4851d 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -906,8 +906,16 @@ class Terminal(Gtk.VBox): self.open_url(url, prepare=True) elif event.button == self.MOUSEBUTTON_MIDDLE: # middleclick should paste the clipboard - middle_click[0](*middle_click[1]) - return(True) + # try to pass it to vte widget first though + if event.get_state() & Gdk.ModifierType.CONTROL_MASK == 0: + if event.get_state() & Gdk.ModifierType.SHIFT_MASK == 0: + if not Vte.Terminal.do_button_press_event(self.vte, event): + middle_click[0](*middle_click[1]) + else: + middle_click[0](*middle_click[1]) + return(True) + return Vte.Terminal.do_button_press_event(self.vte, event) + #return(True) elif event.button == self.MOUSEBUTTON_RIGHT: # rightclick should display a context menu if Ctrl is not pressed, # plus either the app is not interested in mouse events or Shift is pressed