diff options
Diffstat (limited to '')
-rw-r--r-- | terminal.vala | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/terminal.vala b/terminal.vala index 076d665..13409f4 100644 --- a/terminal.vala +++ b/terminal.vala @@ -24,8 +24,7 @@ class Terminal : Gtk.Overlay { [GtkChild] unowned Gtk.InfoBar infobar; [GtkChild] unowned Gtk.Label infobar_label; [GtkChild] unowned Gtk.Menu standard_context_menu; - [GtkChild] unowned Gtk.Menu url_context_menu; - [GtkChild] unowned Gtk.Menu hyperlink_context_menu; + [GtkChild] unowned Gtk.Menu uri_context_menu; [GtkChild] unowned Gtk.MenuItem copy_item_text; [GtkChild] unowned Gtk.MenuItem copy_item_html; [GtkChild] unowned Gtk.MenuItem open_terminal_item; @@ -62,8 +61,7 @@ class Terminal : Gtk.Overlay { vte.search_set_wrap_around(true); - url_context_menu.attach_to_widget(vte, null); - hyperlink_context_menu.attach_to_widget(vte, null); + uri_context_menu.attach_to_widget(vte, null); standard_context_menu.attach_to_widget(vte, null); clipboard = Gtk.Clipboard.get_default(window.get_display()); @@ -403,10 +401,8 @@ class Terminal : Gtk.Overlay { url_match = vte.match_check_event(event, null); hyperlink_match = vte.hyperlink_check_event(event); - if (url_match != null) { - url_context_menu.popup_at_pointer(event); - } else if (hyperlink_match != null) { - hyperlink_context_menu.popup_at_pointer(event); + if (url_match != null || hyperlink_match != null) { + uri_context_menu.popup_at_pointer(event); } else { copy_item_text.set_sensitive(vte.get_has_selection()); copy_item_html.set_sensitive(vte.get_has_selection()); |