@@ -139,6 +139,7 @@ struct GtkDisplayState {
GtkWidget *view_menu_item;
GtkWidget *view_menu;
GtkWidget *full_screen_item;
+ GtkWidget *copy_item;
GtkWidget *zoom_in_item;
GtkWidget *zoom_out_item;
GtkWidget *zoom_fixed_item;
@@ -1263,6 +1264,16 @@ static void gd_menu_full_screen(GtkMenuItem *item, void *opaque)
gd_update_cursor(vc);
}
+static void gd_menu_copy(GtkMenuItem *item, void *opaque)
+{
+ GtkDisplayState *s = opaque;
+ VirtualConsole *vc = gd_vc_find_current(s);
+
+#if defined(CONFIG_VTE)
+ vte_terminal_copy_clipboard(VTE_TERMINAL(vc->vte.terminal));
+#endif
+}
+
static void gd_accel_full_screen(void *opaque)
{
GtkDisplayState *s = opaque;
@@ -1825,6 +1836,8 @@ static void gd_connect_signals(GtkDisplayState *s)
G_CALLBACK(gd_menu_powerdown), s);
g_signal_connect(s->quit_item, "activate",
G_CALLBACK(gd_menu_quit), s);
+ g_signal_connect(s->copy_item, "activate",
+ G_CALLBACK(gd_menu_copy), s);
g_signal_connect(s->full_screen_item, "activate",
G_CALLBACK(gd_menu_full_screen), s);
g_signal_connect(s->zoom_in_item, "activate",
@@ -1958,6 +1971,9 @@ static GtkWidget *gd_create_menu_view(GtkDisplayState *s)
s->full_screen_item = gtk_menu_item_new_with_mnemonic(_("_Fullscreen"));
+ s->copy_item = gtk_menu_item_new_with_mnemonic(_("_Copy"));
+ gtk_menu_shell_append(GTK_MENU_SHELL(view_menu), s->copy_item);
+
gtk_accel_group_connect(s->accel_group, GDK_KEY_f, HOTKEY_MODIFIERS, 0,
g_cclosure_new_swap(G_CALLBACK(gd_accel_full_screen), s, NULL));
#if GTK_CHECK_VERSION(3, 8, 0)