Mercurial > hg > xemacs-beta
comparison src/select-x.c @ 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 | 3d8143fc88e1 |
children | 5e906dd5c3e9 |
comparison
equal
deleted
inserted
replaced
2618:6db7dbf7f88b | 2619:935833be8506 |
---|---|
519 } | 519 } |
520 else | 520 else |
521 { | 521 { |
522 /* Send an INCR selection. */ | 522 /* Send an INCR selection. */ |
523 int prop_id; | 523 int prop_id; |
524 Widget widget = FRAME_X_TEXT_WIDGET (DEVICE_SELECTED_FRAME(d)); | |
524 | 525 |
525 if (x_window_to_frame (d, window)) /* #### debug */ | 526 if (x_window_to_frame (d, window)) /* #### debug */ |
526 invalid_operation ("attempt to transfer an INCR to ourself!", Qunbound); | 527 invalid_operation ("attempt to transfer an INCR to ourself!", |
528 Qunbound); | |
527 #if 0 | 529 #if 0 |
528 stderr_out ("\nINCR %d\n", bytes_remaining); | 530 stderr_out ("\nINCR %d\n", bytes_remaining); |
529 #endif | 531 #endif |
532 | |
533 /* Tell Xt not to drop PropertyNotify events that arrive for the | |
534 target window, rather, pass them to us. This would be a hack, but | |
535 the Xt selection routines are broken for our purposes--we can't | |
536 pass them callbacks from Lisp, for example. Let's call it a | |
537 workaround. */ | |
538 XtRegisterDrawable(display, (Drawable)window, widget); | |
539 | |
530 prop_id = expect_property_change (display, window, reply.property, | 540 prop_id = expect_property_change (display, window, reply.property, |
531 PropertyDelete); | 541 PropertyDelete); |
532 | 542 |
533 XChangeProperty (display, window, reply.property, DEVICE_XATOM_INCR (d), | 543 XChangeProperty (display, window, reply.property, DEVICE_XATOM_INCR (d), |
534 32, PropModeReplace, (Rawbyte *) | 544 32, PropModeReplace, (Rawbyte *) |
568 that we're done. */ | 578 that we're done. */ |
569 #if 0 | 579 #if 0 |
570 stderr_out (" INCR done\n"); | 580 stderr_out (" INCR done\n"); |
571 #endif | 581 #endif |
572 if (! waiting_for_other_props_on_window (display, window)) | 582 if (! waiting_for_other_props_on_window (display, window)) |
583 { | |
573 XSelectInput (display, window, 0L); | 584 XSelectInput (display, window, 0L); |
574 | 585 XtUnregisterDrawable(display, (Drawable)window); |
586 } | |
575 XChangeProperty (display, window, reply.property, type, format, | 587 XChangeProperty (display, window, reply.property, type, format, |
576 PropModeReplace, data, 0); | 588 PropModeReplace, data, 0); |
577 } | 589 } |
578 } | 590 } |
579 | 591 |