X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fdevice-gtk.c;h=83c684f929defb34131e5ec750b71d65f59a1831;hb=ef136db284dffac68f25bb0c170f8ef90c0af387;hp=7bb336bb3b4778af92653762c6a58e6720ba29f9;hpb=21db8709c0c2dcedbd278c7fe571290d5ce80a71;p=chise%2Fxemacs-chise.git.1 diff --git a/src/device-gtk.c b/src/device-gtk.c index 7bb336b..83c684f 100644 --- a/src/device-gtk.c +++ b/src/device-gtk.c @@ -126,6 +126,9 @@ extern void emacs_gtk_selection_handle (GtkWidget *, guint info, guint time_stamp, gpointer data); +extern void emacs_gtk_selection_clear_event_handle (GtkWidget *widget, + GdkEventSelection *event, + gpointer data); extern void emacs_gtk_selection_received (GtkWidget *widget, GtkSelectionData *selection_data, gpointer user_data); @@ -195,7 +198,7 @@ gtk_init_device (struct device *d, Lisp_Object props) XSETDEVICE (device, d); /* gtk_init() and even gtk_check_init() are so brain dead that - getting an empty argv array causes them to abort. */ + getting an empty argv array causes them to ABORT. */ if (NILP (Vgtk_initial_argv_list)) { signal_simple_error ("gtk-initial-argv-list must be set before creating Gtk devices", Vgtk_initial_argv_list); @@ -284,9 +287,15 @@ gtk_init_device (struct device *d, Lisp_Object props) /* Need to set up some selection handlers */ gtk_selection_add_target (GTK_WIDGET (app_shell), GDK_SELECTION_PRIMARY, GDK_SELECTION_TYPE_STRING, 0); + gtk_selection_add_target (GTK_WIDGET (app_shell), + gdk_atom_intern("CLIPBOARD", FALSE), + GDK_SELECTION_TYPE_STRING, 0); gtk_signal_connect (GTK_OBJECT (app_shell), "selection_get", GTK_SIGNAL_FUNC (emacs_gtk_selection_handle), NULL); + gtk_signal_connect (GTK_OBJECT (app_shell), "selection_clear_event", + GTK_SIGNAL_FUNC (emacs_gtk_selection_clear_event_handle), + NULL); gtk_signal_connect (GTK_OBJECT (app_shell), "selection_received", GTK_SIGNAL_FUNC (emacs_gtk_selection_received), NULL);