[gtk+/gtk-2-24] Don't use deprecated API
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] Don't use deprecated API
- Date: Tue, 28 Dec 2010 00:07:07 +0000 (UTC)
commit f9dd531bc9ccec1a407fe7b78c74f6fac242a05e
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Dec 27 19:06:02 2010 -0500
Don't use deprecated API
This should fix copy/paste problems observed with 2.23.3, as seen
eg in http://bugzilla.gnome.org/show_bug.cgi?id=637973
gtk/gtkselection.c | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c
index 5b3ae1d..fa20852 100644
--- a/gtk/gtkselection.c
+++ b/gtk/gtkselection.c
@@ -1316,18 +1316,19 @@ selection_set_compound_text (GtkSelectionData *selection_data,
gint format;
gint new_length;
gboolean result = FALSE;
-
+
+#ifdef GDK_WINDOWING_X11
tmp = g_strndup (str, len);
- if (gdk_utf8_to_compound_text_for_display (selection_data->display, tmp,
- &encoding, &format, &text, &new_length))
+ if (gdk_x11_display_utf8_to_compound_text (selection_data->display, tmp,
+ &encoding, &format, &text, &new_length))
{
gtk_selection_data_set (selection_data, encoding, format, text, new_length);
- gdk_free_compound_text (text);
-
+ gdk_x11_free_compound_text (text);
+
result = TRUE;
}
-
g_free (tmp);
+#endif
return result;
}
@@ -2273,15 +2274,14 @@ _gtk_selection_request (GtkWidget *widget,
info->selection = event->selection;
info->num_incrs = 0;
-
+
/* Create GdkWindow structure for the requestor */
-
- info->requestor = gdk_window_lookup_for_display (display,
- event->requestor);
- if (!info->requestor)
- info->requestor = gdk_window_foreign_new_for_display (display,
- event->requestor);
-
+#ifdef GDK_WINDOWING_X11
+ info->requestor = gdk_x11_window_foreign_new_for_display (display, event->requestor);
+#else
+ info->requestor = NULL;
+#endif
+
/* Determine conversions we need to perform */
if (event->target == gtk_selection_atoms[MULTIPLE])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]