SUPERSEDES 16927.42810.718759.62839(a)parhasard.net
Those of you paying attention to my last patch will, of course, have noticed
that it breaks if XEmacs’ currently selected frame has no relation to the
X11 display on which the selection request is taking place. This fixes that;
unfortunately, the 21.4 patch diverges here, the new widget initialisation
being;
Widget widget = FRAME_X_TEXT_WIDGET(XFRAME(DEVICE_SELECTED_FRAME(d)));
I’ll send a full patch for that if it’s wanted.
src/ChangeLog addition:
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.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/select-x.c
Index: src/select-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/select-x.c,v
retrieving revision 1.17
diff -u -u -r1.17 select-x.c
--- src/select-x.c 2005/01/24 23:34:09 1.17
+++ src/select-x.c 2005/02/26 04:18:50
@@ -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);
}
--
“I, for instance, am gung-ho about open source because my family is being
held hostage in Rob Malda’s basement. But who fact-checks me, or Enderle,
when we say something in public? No-one!” -- Danny O’Brien
Show replies by date
NOTE: this patch has been committed.
Ar an séú lá is fiche de mí Feabhra, scríobh Aidan Kehoe:
SUPERSEDES 16927.42810.718759.62839(a)parhasard.net
--
“I, for instance, am gung-ho about open source because my family is being
held hostage in Rob Malda’s basement. But who fact-checks me, or Enderle,
when we say something in public? No-one!” -- Danny O’Brien