Add setting 'disable_mouse_paste'

This commit is contained in:
Vulcalien 2021-09-12 22:13:01 +02:00
parent 28a2b0328f
commit fa09ba0cda
2 changed files with 11 additions and 9 deletions

View File

@ -110,6 +110,7 @@ DEFAULTS = {
'always_split_with_profile': False, 'always_split_with_profile': False,
'putty_paste_style' : False, 'putty_paste_style' : False,
'putty_paste_style_source_clipboard': False, 'putty_paste_style_source_clipboard': False,
'disable_mouse_paste' : False,
'smart_copy' : True, 'smart_copy' : True,
'clear_select_on_copy' : False, 'clear_select_on_copy' : False,
'line_height' : 1.0, 'line_height' : 1.0,

View File

@ -978,9 +978,9 @@ class Terminal(Gtk.VBox):
if self.config['putty_paste_style']: if self.config['putty_paste_style']:
middle_click = [self.popup_menu, (widget, event)] middle_click = [self.popup_menu, (widget, event)]
right_click = [self.paste_clipboard, (not self.config['putty_paste_style_source_clipboard'], )] right_click = [self.paste_clipboard, (not self.config['putty_paste_style_source_clipboard'], True)]
else: else:
middle_click = [self.paste_clipboard, (True, )] middle_click = [self.paste_clipboard, (True, True)]
right_click = [self.popup_menu, (widget, event)] right_click = [self.popup_menu, (widget, event)]
# Ctrl-click event here. # Ctrl-click event here.
@ -1621,8 +1621,9 @@ class Terminal(Gtk.VBox):
webbrowser.open(url) webbrowser.open(url)
def paste_clipboard(self, primary=False): def paste_clipboard(self, primary=False, mouse=False):
"""Paste one of the two clipboards""" """Paste one of the two clipboards"""
if not (mouse and self.config['disable_mouse_paste']):
for term in self.terminator.get_target_terms(self): for term in self.terminator.get_target_terms(self):
if primary: if primary:
term.vte.paste_primary() term.vte.paste_primary()