changeset 2619:935833be8506

[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.
author aidan
date Mon, 28 Feb 2005 17:02:10 +0000
parents 6db7dbf7f88b
children 5e906dd5c3e9
files src/ChangeLog src/select-x.c
diffstat 2 files changed, 21 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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  <kehoea@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@gmail.com>
 
 	* s/freebsd.h: fix build on the FreeBSD 6
--- 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);
     }