Mercurial > emacs
comparison src/xterm.c @ 90044:cb7f41387eb3
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-70
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-669
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-678
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-679
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-680
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-688
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-689
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-690
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-691
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-69
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-70
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-71
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 12 Nov 2004 02:53:04 +0000 |
parents | e24e2e78deda 95edcd1fae73 |
children | f2ebccfa87d4 |
comparison
equal
deleted
inserted
replaced
90043:e24e2e78deda | 90044:cb7f41387eb3 |
---|---|
5579 0, 0, 0, 0, True); | 5579 0, 0, 0, 0, True); |
5580 #endif /* not USE_TOOLKIT_SCROLL_BARS */ | 5580 #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
5581 } | 5581 } |
5582 | 5582 |
5583 | 5583 |
5584 /* Define a queue to save up SelectionRequest events for later handling. */ | |
5585 | |
5586 struct selection_event_queue | |
5587 { | |
5588 XEvent event; | |
5589 struct selection_event_queue *next; | |
5590 }; | |
5591 | |
5592 static struct selection_event_queue *queue; | |
5593 | |
5594 /* Nonzero means queue up certain events--don't process them yet. */ | |
5595 | |
5596 static int x_queue_selection_requests; | |
5597 | |
5598 /* Queue up an X event *EVENT, to be processed later. */ | |
5599 | |
5600 static void | |
5601 x_queue_event (f, event) | |
5602 FRAME_PTR f; | |
5603 XEvent *event; | |
5604 { | |
5605 struct selection_event_queue *queue_tmp | |
5606 = (struct selection_event_queue *) xmalloc (sizeof (struct selection_event_queue)); | |
5607 | |
5608 if (queue_tmp != NULL) | |
5609 { | |
5610 queue_tmp->event = *event; | |
5611 queue_tmp->next = queue; | |
5612 queue = queue_tmp; | |
5613 } | |
5614 } | |
5615 | |
5616 /* Take all the queued events and put them back | |
5617 so that they get processed afresh. */ | |
5618 | |
5619 static void | |
5620 x_unqueue_events (display) | |
5621 Display *display; | |
5622 { | |
5623 while (queue != NULL) | |
5624 { | |
5625 struct selection_event_queue *queue_tmp = queue; | |
5626 XPutBackEvent (display, &queue_tmp->event); | |
5627 queue = queue_tmp->next; | |
5628 xfree ((char *)queue_tmp); | |
5629 } | |
5630 } | |
5631 | |
5632 /* Start queuing SelectionRequest events. */ | |
5633 | |
5634 void | |
5635 x_start_queuing_selection_requests (display) | |
5636 Display *display; | |
5637 { | |
5638 x_queue_selection_requests++; | |
5639 } | |
5640 | |
5641 /* Stop queuing SelectionRequest events. */ | |
5642 | |
5643 void | |
5644 x_stop_queuing_selection_requests (display) | |
5645 Display *display; | |
5646 { | |
5647 x_queue_selection_requests--; | |
5648 x_unqueue_events (display); | |
5649 } | |
5650 | |
5651 /* The main X event-reading loop - XTread_socket. */ | 5584 /* The main X event-reading loop - XTread_socket. */ |
5652 | 5585 |
5653 #if 0 | 5586 #if 0 |
5654 /* Time stamp of enter window event. This is only used by XTread_socket, | 5587 /* Time stamp of enter window event. This is only used by XTread_socket, |
5655 but we have to put it out here, since static variables within functions | 5588 but we have to put it out here, since static variables within functions |
6023 case SelectionRequest: /* Someone wants our selection. */ | 5956 case SelectionRequest: /* Someone wants our selection. */ |
6024 #ifdef USE_X_TOOLKIT | 5957 #ifdef USE_X_TOOLKIT |
6025 if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner)) | 5958 if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner)) |
6026 goto OTHER; | 5959 goto OTHER; |
6027 #endif /* USE_X_TOOLKIT */ | 5960 #endif /* USE_X_TOOLKIT */ |
6028 if (x_queue_selection_requests) | 5961 { |
6029 x_queue_event (x_window_to_frame (dpyinfo, event.xselectionrequest.owner), | |
6030 &event); | |
6031 else | |
6032 { | |
6033 XSelectionRequestEvent *eventp | 5962 XSelectionRequestEvent *eventp |
6034 = (XSelectionRequestEvent *) &event; | 5963 = (XSelectionRequestEvent *) &event; |
6035 | 5964 |
6036 inev.kind = SELECTION_REQUEST_EVENT; | 5965 inev.kind = SELECTION_REQUEST_EVENT; |
6037 SELECTION_EVENT_DISPLAY (&inev) = eventp->display; | 5966 SELECTION_EVENT_DISPLAY (&inev) = eventp->display; |
6039 SELECTION_EVENT_SELECTION (&inev) = eventp->selection; | 5968 SELECTION_EVENT_SELECTION (&inev) = eventp->selection; |
6040 SELECTION_EVENT_TARGET (&inev) = eventp->target; | 5969 SELECTION_EVENT_TARGET (&inev) = eventp->target; |
6041 SELECTION_EVENT_PROPERTY (&inev) = eventp->property; | 5970 SELECTION_EVENT_PROPERTY (&inev) = eventp->property; |
6042 SELECTION_EVENT_TIME (&inev) = eventp->time; | 5971 SELECTION_EVENT_TIME (&inev) = eventp->time; |
6043 inev.frame_or_window = Qnil; | 5972 inev.frame_or_window = Qnil; |
6044 } | 5973 } |
6045 break; | 5974 break; |
6046 | 5975 |
6047 case PropertyNotify: | 5976 case PropertyNotify: |
6048 #if 0 /* This is plain wrong. In the case that we are waiting for a | 5977 #if 0 /* This is plain wrong. In the case that we are waiting for a |
6049 PropertyNotify used as an ACK in incremental selection | 5978 PropertyNotify used as an ACK in incremental selection |
7624 Display *dpy = XSAVE_VALUE (first)->pointer; | 7553 Display *dpy = XSAVE_VALUE (first)->pointer; |
7625 | 7554 |
7626 /* The display may have been closed before this function is called. | 7555 /* The display may have been closed before this function is called. |
7627 Check if it is still open before calling XSync. */ | 7556 Check if it is still open before calling XSync. */ |
7628 if (x_display_info_for_display (dpy) != 0) | 7557 if (x_display_info_for_display (dpy) != 0) |
7629 XSync (dpy, False); | 7558 { |
7559 BLOCK_INPUT; | |
7560 XSync (dpy, False); | |
7561 UNBLOCK_INPUT; | |
7562 } | |
7630 | 7563 |
7631 x_error_message_string = XCDR (old_val); | 7564 x_error_message_string = XCDR (old_val); |
7632 return Qnil; | 7565 return Qnil; |
7633 } | 7566 } |
7634 | 7567 |