comparison pidgin/gtkimhtml.c @ 21557:cba1683eeafc

There appears to be a new GTK+ bug that causes the clipboard_clear callback to be triggered *after* the clipboard_copy callback on the second copy attempt. This makes stuff still work correctly when this happens (and, most importantly, not crash). I'll report this upstream.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 16 Nov 2007 18:43:50 +0000
parents 277873603719
children adc4da4ff21c
comparison
equal deleted inserted replaced
21556:4e98fb3661cc 21557:cba1683eeafc
897 gboolean primary = (clipboard != clipboard_selection); 897 gboolean primary = (clipboard != clipboard_selection);
898 GtkTextIter start, end; 898 GtkTextIter start, end;
899 899
900 if (primary) { 900 if (primary) {
901 GtkTextMark *sel = NULL, *ins = NULL; 901 GtkTextMark *sel = NULL, *ins = NULL;
902
903 g_return_if_fail(imhtml != NULL);
904
902 ins = gtk_text_buffer_get_insert(imhtml->text_buffer); 905 ins = gtk_text_buffer_get_insert(imhtml->text_buffer);
903 sel = gtk_text_buffer_get_selection_bound(imhtml->text_buffer); 906 sel = gtk_text_buffer_get_selection_bound(imhtml->text_buffer);
904 gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &start, sel); 907 gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &start, sel);
905 gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &end, ins); 908 gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &end, ins);
906 } 909 }
955 } 958 }
956 959
957 static void gtk_imhtml_clipboard_clear (GtkClipboard *clipboard, GtkSelectionData *sel_data, 960 static void gtk_imhtml_clipboard_clear (GtkClipboard *clipboard, GtkSelectionData *sel_data,
958 guint info, gpointer user_data_or_owner) 961 guint info, gpointer user_data_or_owner)
959 { 962 {
963 #ifndef _WIN32
960 clipboard_selection = NULL; 964 clipboard_selection = NULL;
965 #endif
961 } 966 }
962 967
963 static void copy_clipboard_cb(GtkIMHtml *imhtml, gpointer unused) 968 static void copy_clipboard_cb(GtkIMHtml *imhtml, gpointer unused)
964 { 969 {
965 GtkTextIter start, end; 970 GtkTextIter start, end;