From b85796d64b9418fc855f7a2e427cebcd3121e6a0 Mon Sep 17 00:00:00 2001 From: Stephen Boddy Date: Sun, 29 Nov 2015 23:43:45 +0100 Subject: [PATCH] Fix Ctrl-click on URL if terminal has padding --- terminatorlib/terminal.py | 7 +------ terminatorlib/terminal_popup_menu.py | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 427a2739..3a2b912f 100755 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -920,7 +920,7 @@ class Terminal(Gtk.VBox): if event.button == 1: # Ctrl+leftclick on a URL should open it if event.get_state() & Gdk.ModifierType.CONTROL_MASK == Gdk.ModifierType.CONTROL_MASK: - url = self.check_for_url(event) + url = self.vte.match_check_event(event) if url[0]: self.open_url(url, prepare=True) elif event.button == 2: @@ -1418,11 +1418,6 @@ class Terminal(Gtk.VBox): self.vte.feed(_('Unable to start shell:') + shell) return(-1) - def check_for_url(self, event): - """Check if the mouse is over a URL""" - return (self.vte.match_check(int(event.x / self.vte.get_char_width()), - int(event.y / self.vte.get_char_height()))) - def prepare_url(self, urlmatch): """Prepare a URL from a VTE match""" url = urlmatch[0] diff --git a/terminatorlib/terminal_popup_menu.py b/terminatorlib/terminal_popup_menu.py index b672e083..4b7d91cd 100755 --- a/terminatorlib/terminal_popup_menu.py +++ b/terminatorlib/terminal_popup_menu.py @@ -40,7 +40,7 @@ class TerminalPopupMenu(object): self.config.set_profile(terminal.get_profile()) if event: - url = terminal.check_for_url(event) + url = terminal.vte.match_check_event(event) button = event.button time = event.time else: