aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/text/e-text.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c
index 2800baac3e..a8d4c4509b 100644
--- a/widgets/text/e-text.c
+++ b/widgets/text/e-text.c
@@ -2323,8 +2323,13 @@ e_text_copy_clipboard (EText *text)
str = g_strndup (text->text + selection_start_pos,
selection_end_pos - selection_start_pos);
- gtk_clipboard_set_text (gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas),
+ gtk_clipboard_set_text (
+#ifdef GTK_2_2
+ gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas),
GDK_SELECTION_CLIPBOARD),
+#else
+ gtk_clipboard_get (GDK_SELECTION_CLIPBOARD),
+#endif
str, -1);
g_free (str);
}
@@ -2417,7 +2422,11 @@ e_text_update_primary_selection (EText *text)
};
GtkClipboard *clipboard;
+#ifdef GTK_2_2
clipboard = gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), GDK_SELECTION_PRIMARY);
+#else
+ clipboard = gtk_clipboard_get (GDK_SELECTION_PRIMARY);
+#endif
if (text->selection_start != text->selection_end) {
if (!gtk_clipboard_set_with_owner (clipboard, targets, G_N_ELEMENTS (targets),
@@ -2451,8 +2460,14 @@ static void
e_text_paste (EText *text, GdkAtom selection)
{
g_object_ref (text);
- gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas),
+ gtk_clipboard_request_text (
+#ifdef GTK_2_2
+
+ gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas),
selection),
+#else
+ gtk_clipboard_get (selection),
+#endif
paste_received, text);
}
@@ -2556,8 +2571,14 @@ e_text_do_popup (EText *text, GdkEventButton *button, int position)
closure->button = button;
closure->position = position;
- gtk_clipboard_request_contents (gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas),
+ gtk_clipboard_request_contents (
+#ifdef GTK_2_2
+
+ gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas),
GDK_SELECTION_CLIPBOARD),
+#else
+ gtk_clipboard_get (GDK_SELECTION_CLIPBOARD),
+#endif
gdk_atom_intern ("TARGETS", FALSE),
popup_targets_received,
closure);