|
@@ -82,7 +82,7 @@ static void mssh_window_insert(GtkWidget *widget, gchar *new_text,
|
|
|
|
|
|
for(i = 0; i < window->terminals->len; i++)
|
|
|
{
|
|
|
- fprintf(stderr, "Sending text '%s' to terminal %d\n", new_text, i);
|
|
|
+
|
|
|
mssh_terminal_send_string(g_array_index(window->terminals,
|
|
|
MSSHTerminal*, i), new_text);
|
|
|
}
|
|
@@ -94,14 +94,28 @@ static gboolean mssh_window_key_press(GtkWidget *widget,
|
|
|
GdkEventKey *event, gpointer data)
|
|
|
{
|
|
|
int i;
|
|
|
+ MSSHTerminal *term;
|
|
|
+ GtkClipboard *clipboard;
|
|
|
+ GdkAtom atom;
|
|
|
+ gchar *text;
|
|
|
|
|
|
MSSHWindow *window = MSSH_WINDOW(data);
|
|
|
|
|
|
for(i = 0; i < window->terminals->len; i++)
|
|
|
{
|
|
|
- fprintf(stderr, "Sending keyval %d to terminal %d\n", event->keyval, i);
|
|
|
+ term = MSSH_TERMINAL(g_array_index(window->terminals,MSSHTerminal*, i));
|
|
|
+ if ( ( term->CodeAnt == 65505 ) && ( event->keyval == 65379 ) ) {
|
|
|
+ atom = gdk_atom_intern("PRIMARY", TRUE);
|
|
|
+ clipboard = gtk_clipboard_get(atom);
|
|
|
+ text = gtk_clipboard_wait_for_text (clipboard);
|
|
|
+ fprintf(stderr,"Requesting PRIMARY clipboard content as text on terminal %d\n", i);
|
|
|
+ fprintf(stderr,"Clipboard has this text: %s\n",text);
|
|
|
+ g_free(text);
|
|
|
+ }
|
|
|
+
|
|
|
mssh_terminal_send_data(g_array_index(window->terminals,
|
|
|
MSSHTerminal*, i), event);
|
|
|
+ term->CodeAnt = event->keyval;
|
|
|
}
|
|
|
|
|
|
return TRUE;
|
|
@@ -360,6 +374,7 @@ void mssh_window_relayout(MSSHWindow *window)
|
|
|
static void mssh_window_add_session(MSSHWindow *window, char *hostname)
|
|
|
{
|
|
|
MSSHTerminal *terminal = MSSH_TERMINAL(mssh_terminal_new());
|
|
|
+ terminal->CodeAnt = 0;
|
|
|
|
|
|
g_array_append_val(window->terminals, terminal);
|
|
|
|