Mercurial > emacs
comparison src/xterm.c @ 83224:7a0245dd1848
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-653
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-654
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-655
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-656
Update from CVS: lisp/man.el (Man-xref-normal-file): Fix help-echo.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-657
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-658
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-659
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-660
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-661
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-662
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-663
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-664
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-665
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-666
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-667
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-669
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-670
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-671
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-64
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-65
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-66
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-67
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-68
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-264
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 06 Nov 2004 17:52:02 +0000 |
parents | ae7fab96922c 95edcd1fae73 |
children | 2a3f27a45698 |
comparison
equal
deleted
inserted
replaced
83223:4056279af756 | 83224:7a0245dd1848 |
---|---|
3920 Display *display; | 3920 Display *display; |
3921 Window window_id; | 3921 Window window_id; |
3922 { | 3922 { |
3923 Lisp_Object tail; | 3923 Lisp_Object tail; |
3924 | 3924 |
3925 #ifdef USE_GTK | 3925 #if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS) |
3926 window_id = (Window) xg_get_scroll_id_for_window (display, window_id); | 3926 window_id = (Window) xg_get_scroll_id_for_window (display, window_id); |
3927 #endif /* USE_GTK */ | 3927 #endif /* USE_GTK && USE_TOOLKIT_SCROLL_BARS */ |
3928 | 3928 |
3929 for (tail = Vframe_list; | 3929 for (tail = Vframe_list; |
3930 XGCTYPE (tail) == Lisp_Cons; | 3930 XGCTYPE (tail) == Lisp_Cons; |
3931 tail = XCDR (tail)) | 3931 tail = XCDR (tail)) |
3932 { | 3932 { |
5577 0, 0, 0, 0, True); | 5577 0, 0, 0, 0, True); |
5578 #endif /* not USE_TOOLKIT_SCROLL_BARS */ | 5578 #endif /* not USE_TOOLKIT_SCROLL_BARS */ |
5579 } | 5579 } |
5580 | 5580 |
5581 | 5581 |
5582 /* Define a queue to save up SelectionRequest events for later handling. */ | |
5583 | |
5584 struct selection_event_queue | |
5585 { | |
5586 XEvent event; | |
5587 struct selection_event_queue *next; | |
5588 }; | |
5589 | |
5590 static struct selection_event_queue *queue; | |
5591 | |
5592 /* Nonzero means queue up certain events--don't process them yet. */ | |
5593 | |
5594 static int x_queue_selection_requests; | |
5595 | |
5596 /* Queue up an X event *EVENT, to be processed later. */ | |
5597 | |
5598 static void | |
5599 x_queue_event (f, event) | |
5600 FRAME_PTR f; | |
5601 XEvent *event; | |
5602 { | |
5603 struct selection_event_queue *queue_tmp | |
5604 = (struct selection_event_queue *) xmalloc (sizeof (struct selection_event_queue)); | |
5605 | |
5606 if (queue_tmp != NULL) | |
5607 { | |
5608 queue_tmp->event = *event; | |
5609 queue_tmp->next = queue; | |
5610 queue = queue_tmp; | |
5611 } | |
5612 } | |
5613 | |
5614 /* Take all the queued events and put them back | |
5615 so that they get processed afresh. */ | |
5616 | |
5617 static void | |
5618 x_unqueue_events (display) | |
5619 Display *display; | |
5620 { | |
5621 while (queue != NULL) | |
5622 { | |
5623 struct selection_event_queue *queue_tmp = queue; | |
5624 XPutBackEvent (display, &queue_tmp->event); | |
5625 queue = queue_tmp->next; | |
5626 xfree ((char *)queue_tmp); | |
5627 } | |
5628 } | |
5629 | |
5630 /* Start queuing SelectionRequest events. */ | |
5631 | |
5632 void | |
5633 x_start_queuing_selection_requests (display) | |
5634 Display *display; | |
5635 { | |
5636 x_queue_selection_requests++; | |
5637 } | |
5638 | |
5639 /* Stop queuing SelectionRequest events. */ | |
5640 | |
5641 void | |
5642 x_stop_queuing_selection_requests (display) | |
5643 Display *display; | |
5644 { | |
5645 x_queue_selection_requests--; | |
5646 x_unqueue_events (display); | |
5647 } | |
5648 | |
5649 /* The main X event-reading loop - XTread_socket. */ | 5582 /* The main X event-reading loop - XTread_socket. */ |
5650 | 5583 |
5651 #if 0 | 5584 #if 0 |
5652 /* Time stamp of enter window event. This is only used by XTread_socket, | 5585 /* Time stamp of enter window event. This is only used by XTread_socket, |
5653 but we have to put it out here, since static variables within functions | 5586 but we have to put it out here, since static variables within functions |
6021 case SelectionRequest: /* Someone wants our selection. */ | 5954 case SelectionRequest: /* Someone wants our selection. */ |
6022 #ifdef USE_X_TOOLKIT | 5955 #ifdef USE_X_TOOLKIT |
6023 if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner)) | 5956 if (!x_window_to_frame (dpyinfo, event.xselectionrequest.owner)) |
6024 goto OTHER; | 5957 goto OTHER; |
6025 #endif /* USE_X_TOOLKIT */ | 5958 #endif /* USE_X_TOOLKIT */ |
6026 if (x_queue_selection_requests) | 5959 { |
6027 x_queue_event (x_window_to_frame (dpyinfo, event.xselectionrequest.owner), | |
6028 &event); | |
6029 else | |
6030 { | |
6031 XSelectionRequestEvent *eventp | 5960 XSelectionRequestEvent *eventp |
6032 = (XSelectionRequestEvent *) &event; | 5961 = (XSelectionRequestEvent *) &event; |
6033 | 5962 |
6034 inev.kind = SELECTION_REQUEST_EVENT; | 5963 inev.kind = SELECTION_REQUEST_EVENT; |
6035 SELECTION_EVENT_DISPLAY (&inev) = eventp->display; | 5964 SELECTION_EVENT_DISPLAY (&inev) = eventp->display; |
6037 SELECTION_EVENT_SELECTION (&inev) = eventp->selection; | 5966 SELECTION_EVENT_SELECTION (&inev) = eventp->selection; |
6038 SELECTION_EVENT_TARGET (&inev) = eventp->target; | 5967 SELECTION_EVENT_TARGET (&inev) = eventp->target; |
6039 SELECTION_EVENT_PROPERTY (&inev) = eventp->property; | 5968 SELECTION_EVENT_PROPERTY (&inev) = eventp->property; |
6040 SELECTION_EVENT_TIME (&inev) = eventp->time; | 5969 SELECTION_EVENT_TIME (&inev) = eventp->time; |
6041 inev.frame_or_window = Qnil; | 5970 inev.frame_or_window = Qnil; |
6042 } | 5971 } |
6043 break; | 5972 break; |
6044 | 5973 |
6045 case PropertyNotify: | 5974 case PropertyNotify: |
6046 #if 0 /* This is plain wrong. In the case that we are waiting for a | 5975 #if 0 /* This is plain wrong. In the case that we are waiting for a |
6047 PropertyNotify used as an ACK in incremental selection | 5976 PropertyNotify used as an ACK in incremental selection |
7621 Display *dpy = XSAVE_VALUE (first)->pointer; | 7550 Display *dpy = XSAVE_VALUE (first)->pointer; |
7622 | 7551 |
7623 /* The display may have been closed before this function is called. | 7552 /* The display may have been closed before this function is called. |
7624 Check if it is still open before calling XSync. */ | 7553 Check if it is still open before calling XSync. */ |
7625 if (x_display_info_for_display (dpy) != 0) | 7554 if (x_display_info_for_display (dpy) != 0) |
7626 XSync (dpy, False); | 7555 { |
7556 BLOCK_INPUT; | |
7557 XSync (dpy, False); | |
7558 UNBLOCK_INPUT; | |
7559 } | |
7627 | 7560 |
7628 x_error_message_string = XCDR (old_val); | 7561 x_error_message_string = XCDR (old_val); |
7629 return Qnil; | 7562 return Qnil; |
7630 } | 7563 } |
7631 | 7564 |