# HG changeset patch # User aidan # Date 1109610130 0 # Node ID 935833be850699cab76c078983d0ffbe47b02237 # Parent 6db7dbf7f88bb59ed68b1240d96352df2c2eb4d5 [xemacs-hg @ 2005-02-28 17:02:09 by aidan] Register the source window as an Xt drawable when receiving an incremental selection transfer. This stops XEmacs looping until interrupted. diff -r 6db7dbf7f88b -r 935833be8506 src/ChangeLog --- a/src/ChangeLog Mon Feb 28 07:43:18 2005 +0000 +++ b/src/ChangeLog Mon Feb 28 17:02:10 2005 +0000 @@ -1,3 +1,10 @@ +2005-02-26 Aidan Kehoe + + * select-x.c (x_reply_selection_request): Use XtRegisterDrawable + to tell Xt not to drop PropertyChange events destined for the + selection request target window. This makes incremental selection + transfer work, instead of looping until interrupted. + 2005-01-06 Andrey Slusar * s/freebsd.h: fix build on the FreeBSD 6 diff -r 6db7dbf7f88b -r 935833be8506 src/select-x.c --- a/src/select-x.c Mon Feb 28 07:43:18 2005 +0000 +++ b/src/select-x.c Mon Feb 28 17:02:10 2005 +0000 @@ -521,12 +521,22 @@ { /* Send an INCR selection. */ int prop_id; + Widget widget = FRAME_X_TEXT_WIDGET (DEVICE_SELECTED_FRAME(d)); if (x_window_to_frame (d, window)) /* #### debug */ - invalid_operation ("attempt to transfer an INCR to ourself!", Qunbound); + invalid_operation ("attempt to transfer an INCR to ourself!", + Qunbound); #if 0 stderr_out ("\nINCR %d\n", bytes_remaining); #endif + + /* Tell Xt not to drop PropertyNotify events that arrive for the + target window, rather, pass them to us. This would be a hack, but + the Xt selection routines are broken for our purposes--we can't + pass them callbacks from Lisp, for example. Let's call it a + workaround. */ + XtRegisterDrawable(display, (Drawable)window, widget); + prop_id = expect_property_change (display, window, reply.property, PropertyDelete); @@ -570,8 +580,10 @@ stderr_out (" INCR done\n"); #endif if (! waiting_for_other_props_on_window (display, window)) + { XSelectInput (display, window, 0L); - + XtUnregisterDrawable(display, (Drawable)window); + } XChangeProperty (display, window, reply.property, type, format, PropModeReplace, data, 0); }