Fix Ctrl-click on URL if terminal has padding
This commit is contained in:
parent
14fb184df8
commit
b85796d64b
@ -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]
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user