comparison src/gtkimhtml.c @ 7353:dc35b4a42fea

[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 <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 27 Oct 2003 19:47:57 +0000
parents 15155dbc768a
children 5a35881e9e89
comparison
equal deleted inserted replaced
7352:af0e0b4d0c32 7353:dc35b4a42fea
374 } 374 }
375 } 375 }
376 text = gtk_text_buffer_get_text(imhtml->text_buffer, &last, &end, FALSE); 376 text = gtk_text_buffer_get_text(imhtml->text_buffer, &last, &end, FALSE);
377 str = g_string_append(str, text); 377 str = g_string_append(str, text);
378 g_free(text); 378 g_free(text);
379 379
380 gtk_clipboard_set_text(clipboard, str->str, str->len); 380 if (!gtk_text_iter_equal(&start, &last);
381 gtk_clipboard_set_text(clipboard ? clipboard :
382 gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_CLIPBOARD),
383 str->str, str->len);
381 g_string_free(str, TRUE); 384 g_string_free(str, TRUE);
382 } 385 }
383 386
384 static gboolean button_release_cb(GtkIMHtml *imhtml, GdkEventButton event, gpointer the_foibles_of_man) 387 static gboolean button_release_cb(GtkIMHtml *imhtml, GdkEventButton event, gpointer the_foibles_of_man)
385 { 388 {
486 489
487 g_signal_connect(G_OBJECT(imhtml), "size-allocate", G_CALLBACK(gtk_size_allocate_cb), NULL); 490 g_signal_connect(G_OBJECT(imhtml), "size-allocate", G_CALLBACK(gtk_size_allocate_cb), NULL);
488 g_signal_connect(G_OBJECT(imhtml), "motion-notify-event", G_CALLBACK(gtk_motion_event_notify), NULL); 491 g_signal_connect(G_OBJECT(imhtml), "motion-notify-event", G_CALLBACK(gtk_motion_event_notify), NULL);
489 g_signal_connect(G_OBJECT(imhtml), "leave-notify-event", G_CALLBACK(gtk_leave_event_notify), NULL); 492 g_signal_connect(G_OBJECT(imhtml), "leave-notify-event", G_CALLBACK(gtk_leave_event_notify), NULL);
490 g_signal_connect(G_OBJECT(imhtml), "key_press_event", G_CALLBACK(gtk_key_pressed_cb), NULL); 493 g_signal_connect(G_OBJECT(imhtml), "key_press_event", G_CALLBACK(gtk_key_pressed_cb), NULL);
491 g_signal_connect(G_OBJECT(imhtml), "copy-clipboard", G_CALLBACK(copy_clipboard_cb), 494 g_signal_connect(G_OBJECT(imhtml), "copy-clipboard", G_CALLBACK(copy_clipboard_cb), NULL);
492 gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_CLIPBOARD));
493 g_signal_connect(G_OBJECT(imhtml), "button-release-event", G_CALLBACK(button_release_cb), imhtml); 495 g_signal_connect(G_OBJECT(imhtml), "button-release-event", G_CALLBACK(button_release_cb), imhtml);
494 gtk_widget_add_events(GTK_WIDGET(imhtml), GDK_LEAVE_NOTIFY_MASK); 496 gtk_widget_add_events(GTK_WIDGET(imhtml), GDK_LEAVE_NOTIFY_MASK);
495 497
496 imhtml->tip = NULL; 498 imhtml->tip = NULL;
497 imhtml->tip_timer = 0; 499 imhtml->tip_timer = 0;