diff options
| author | Richard M. Stallman | 1994-10-04 19:38:53 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-10-04 19:38:53 +0000 |
| commit | c0a04927384f3254c83a97ea4cf1c5f808324e25 (patch) | |
| tree | e702db5dbed185e1732a2e62887662ccc51c17ed /src | |
| parent | 8ed87156cf17bc2449243d10b6b1215b436c7841 (diff) | |
| download | emacs-c0a04927384f3254c83a97ea4cf1c5f808324e25.tar.gz emacs-c0a04927384f3254c83a97ea4cf1c5f808324e25.zip | |
(input_signal_count): New variable.
(XTread_socket): Increment it.
(x_make_frame_visible): Exit final loop when XTread_sockets has run.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c index 3fdd78de1c8..bb290730c32 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -288,6 +288,13 @@ static int mouse_face_mouse_x, mouse_face_mouse_y; | |||
| 288 | /* Nonzero means defer mouse-motion highlighting. */ | 288 | /* Nonzero means defer mouse-motion highlighting. */ |
| 289 | static int mouse_face_defer; | 289 | static int mouse_face_defer; |
| 290 | 290 | ||
| 291 | /* Incremented by XTread_socket whenever it really tries to read events. */ | ||
| 292 | #ifdef __STDC__ | ||
| 293 | static int volatile input_signal_count; | ||
| 294 | #else | ||
| 295 | static int input_signal_count; | ||
| 296 | #endif | ||
| 297 | |||
| 291 | /* `t' if a mouse button is depressed. */ | 298 | /* `t' if a mouse button is depressed. */ |
| 292 | 299 | ||
| 293 | extern Lisp_Object Vmouse_depressed; | 300 | extern Lisp_Object Vmouse_depressed; |
| @@ -3166,7 +3173,10 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 3166 | 3173 | ||
| 3167 | interrupt_input_pending = 0; | 3174 | interrupt_input_pending = 0; |
| 3168 | BLOCK_INPUT; | 3175 | BLOCK_INPUT; |
| 3169 | 3176 | ||
| 3177 | /* So people can tell when we have read the available input. */ | ||
| 3178 | input_signal_count++; | ||
| 3179 | |||
| 3170 | if (numchars <= 0) | 3180 | if (numchars <= 0) |
| 3171 | abort (); /* Don't think this happens. */ | 3181 | abort (); /* Don't think this happens. */ |
| 3172 | 3182 | ||
| @@ -4905,7 +4915,6 @@ XTframe_raise_lower (f, raise) | |||
| 4905 | x_lower_frame (f); | 4915 | x_lower_frame (f); |
| 4906 | } | 4916 | } |
| 4907 | 4917 | ||
| 4908 | |||
| 4909 | /* Change from withdrawn state to mapped state, | 4918 | /* Change from withdrawn state to mapped state, |
| 4910 | or deiconify. */ | 4919 | or deiconify. */ |
| 4911 | 4920 | ||
| @@ -4941,17 +4950,28 @@ x_make_frame_visible (f) | |||
| 4941 | 4950 | ||
| 4942 | XFlushQueue (); | 4951 | XFlushQueue (); |
| 4943 | 4952 | ||
| 4944 | UNBLOCK_INPUT; | ||
| 4945 | |||
| 4946 | /* Synchronize to ensure Emacs knows the frame is visible | 4953 | /* Synchronize to ensure Emacs knows the frame is visible |
| 4947 | before we do anything else. We do this loop with input not blocked | 4954 | before we do anything else. We do this loop with input not blocked |
| 4948 | so that incoming events are handled. */ | 4955 | so that incoming events are handled. */ |
| 4949 | { | 4956 | { |
| 4950 | Lisp_Object frame; | 4957 | Lisp_Object frame; |
| 4958 | int count = input_signal_count; | ||
| 4959 | |||
| 4960 | /* This must come after we set COUNT. */ | ||
| 4961 | UNBLOCK_INPUT; | ||
| 4962 | |||
| 4951 | XSET (frame, Lisp_Frame, f); | 4963 | XSET (frame, Lisp_Frame, f); |
| 4952 | while (! f->async_visible) | 4964 | |
| 4965 | while (1) | ||
| 4953 | { | 4966 | { |
| 4954 | x_sync (frame); | 4967 | x_sync (frame); |
| 4968 | /* Once we have handled input events, | ||
| 4969 | we should have received the MapNotify if one is coming. | ||
| 4970 | So if we have not got it yet, stop looping. | ||
| 4971 | Some window managers make their own decisions | ||
| 4972 | about visibility. */ | ||
| 4973 | if (input_signal_count != count) | ||
| 4974 | break; | ||
| 4955 | /* Machines that do polling rather than SIGIO have been observed | 4975 | /* Machines that do polling rather than SIGIO have been observed |
| 4956 | to go into a busy-wait here. So we'll fake an alarm signal | 4976 | to go into a busy-wait here. So we'll fake an alarm signal |
| 4957 | to let the handler know that there's something to be read. | 4977 | to let the handler know that there's something to be read. |
| @@ -4964,6 +4984,13 @@ x_make_frame_visible (f) | |||
| 4964 | alarm (0); | 4984 | alarm (0); |
| 4965 | input_poll_signal (); | 4985 | input_poll_signal (); |
| 4966 | } | 4986 | } |
| 4987 | /* Once we have handled input events, | ||
| 4988 | we should have received the MapNotify if one is coming. | ||
| 4989 | So if we have not got it yet, stop looping. | ||
| 4990 | Some window managers make their own decisions | ||
| 4991 | about visibility. */ | ||
| 4992 | if (input_signal_count != count) | ||
| 4993 | break; | ||
| 4967 | } | 4994 | } |
| 4968 | FRAME_SAMPLE_VISIBILITY (f); | 4995 | FRAME_SAMPLE_VISIBILITY (f); |
| 4969 | } | 4996 | } |