# HG changeset patch # User Sean Egan # Date 1067284077 0 # Node ID dc35b4a42fea8c324c0024c4113a4e5812baef5a # Parent af0e0b4d0c3272614fc6a49f17c1d708612a7251 [gaim-migrate @ 7944] This gets rid of the gtk critical warning regarding clipboards and fixes the broken highlighting (when highlighting text with no smileys... I'm not sure how to get that to work when there are smileys... but I'll work on it.) committer: Tailor Script diff -r af0e0b4d0c32 -r dc35b4a42fea src/gtkimhtml.c --- a/src/gtkimhtml.c Mon Oct 27 18:40:11 2003 +0000 +++ b/src/gtkimhtml.c Mon Oct 27 19:47:57 2003 +0000 @@ -376,8 +376,11 @@ text = gtk_text_buffer_get_text(imhtml->text_buffer, &last, &end, FALSE); str = g_string_append(str, text); g_free(text); - - gtk_clipboard_set_text(clipboard, str->str, str->len); + + if (!gtk_text_iter_equal(&start, &last); + gtk_clipboard_set_text(clipboard ? clipboard : + gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_CLIPBOARD), + str->str, str->len); g_string_free(str, TRUE); } @@ -488,8 +491,7 @@ g_signal_connect(G_OBJECT(imhtml), "motion-notify-event", G_CALLBACK(gtk_motion_event_notify), NULL); g_signal_connect(G_OBJECT(imhtml), "leave-notify-event", G_CALLBACK(gtk_leave_event_notify), NULL); g_signal_connect(G_OBJECT(imhtml), "key_press_event", G_CALLBACK(gtk_key_pressed_cb), NULL); - g_signal_connect(G_OBJECT(imhtml), "copy-clipboard", G_CALLBACK(copy_clipboard_cb), - gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_CLIPBOARD)); + g_signal_connect(G_OBJECT(imhtml), "copy-clipboard", G_CALLBACK(copy_clipboard_cb), NULL); g_signal_connect(G_OBJECT(imhtml), "button-release-event", G_CALLBACK(button_release_cb), imhtml); gtk_widget_add_events(GTK_WIDGET(imhtml), GDK_LEAVE_NOTIFY_MASK);