User: aidan
Date: 05/02/28 18:02:13
Modified: xemacs/src ChangeLog select-x.c
Log:
Register the source window as an Xt drawable when receiving an
incremental selection transfer. This stops XEmacs looping until
interrupted.
Revision Changes Path
1.795 +7 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.794
retrieving revision 1.795
diff -u -r1.794 -r1.795
--- ChangeLog 2005/02/22 11:04:57 1.794
+++ ChangeLog 2005/02/28 17:02:09 1.795
@@ -1,3 +1,10 @@
+2005-02-26 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * 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 <anrays(a)gmail.com>
* s/freebsd.h: fix build on the FreeBSD 6
1.18 +14 -2 XEmacs/xemacs/src/select-x.c
Index: select-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/select-x.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- select-x.c 2005/01/24 23:34:09 1.17
+++ select-x.c 2005/02/28 17:02:10 1.18
@@ -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);
}