Copy URI to XA_CLIPBOARD on right click

Small patch that copies the match into the default clipboard using
gtk_clipboard_set_text(). Maybe consider which clipboard to use
(such as PRIMARY OR SECONDARY) instead based on a config option, although
that may be overkill (especially since PRIMARY is supposed to be ephemeral
or something)

Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com>
This commit is contained in:
numeral 2014-02-05 17:17:20 -05:00 committed by Simon Gomizelj
parent 531d0851ea
commit 23591fd14f
1 changed files with 3 additions and 0 deletions

View File

@ -923,6 +923,9 @@ gboolean button_press_cb(VteTerminal *vte, GdkEventButton *event, const config_i
launch_browser(info->browser, match);
g_free(match);
return TRUE;
} else if(event->button == 3 && event->type == GDK_BUTTON_PRESS && match) {
GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text(clipboard, match, -1);
}
}
return FALSE;