Commit 664fb4965edd9c2c20b68d2139e932ce48c4f88c

Authored by Perry Werneck
1 parent f9328952
Exists in master and in 1 other branch develop

Small adjustments in clipboard management code.

Showing 2 changed files with 12 additions and 8 deletions   Show diff stats
src/terminal/selection.c
... ... @@ -79,6 +79,17 @@ static void clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionDa
79 79 }
80 80  
81 81 /**
  82 + * Clear clipboard contents.
  83 + *
  84 + * @param terminal Pointer to the terminal Widget.
  85 + *
  86 + */
  87 +void v3270_clear_clipboard(v3270 *terminal)
  88 +{
  89 + terminal->selection.text = lib3270_free(terminal->selection.text);
  90 +}
  91 +
  92 +/**
82 93 * Get text at informed area.
83 94 *
84 95 * @param widget Widget.
... ... @@ -109,10 +120,8 @@ LIB3270_EXPORT gchar * v3270_get_text(GtkWidget *widget, int offset, int len)
109 120  
110 121 static const char * update_selected_text(GtkWidget *widget, gboolean cut)
111 122 {
112   - v3270 * terminal;
113 123 char * text;
114   -
115   - terminal = GTK_V3270(widget);
  124 + v3270 * terminal = GTK_V3270(widget);
116 125  
117 126 v3270_clear_clipboard(terminal);
118 127  
... ...
src/terminal/widget.c
... ... @@ -568,11 +568,6 @@ LIB3270_EXPORT GtkWidget * v3270_new(void)
568 568 return g_object_new(GTK_TYPE_V3270, NULL);
569 569 }
570 570  
571   -void v3270_clear_clipboard(v3270 *terminal)
572   -{
573   - terminal->selection.text = lib3270_free(terminal->selection.text);
574   -}
575   -
576 571 static void v3270_destroy(GtkWidget *widget)
577 572 {
578 573 v3270 * terminal = GTK_V3270(widget);
... ...