aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>1999-12-30 11:45:10 +0000
committerGerd Moellmann <[email protected]>1999-12-30 11:45:10 +0000
commit12ce2351b5291680021a68ed1122eb1636555053 (patch)
treea754d9583e615979db8e15f02356b7e6d23f8894 /src/xterm.c
parent04ee4f45e1368119d95c98453b2f755728d50f81 (diff)
(x_make_frame_visible): Wait for frame becoming visible
differently.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 811bfcf45f..0f2c50fcbc 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11298,7 +11298,7 @@ x_make_frame_visible (f)
so that incoming events are handled. */
{
Lisp_Object frame;
- int count = input_signal_count;
+ int count;
/* This must be before UNBLOCK_INPUT
since events that arrive in response to the actions above
will set it when they are handled. */
@@ -11350,37 +11350,33 @@ x_make_frame_visible (f)
XSETFRAME (frame, f);
- while (1)
+ /* Wait until the frame is visible. Process X events until a
+ MapNotify event has been seen, or until we think we won't get a
+ MapNotify at all.. */
+ for (count = input_signal_count + 10;
+ input_signal_count < count && !FRAME_VISIBLE_P (f);)
{
+ /* Force processing of queued events. */
x_sync (f);
- /* Once we have handled input events,
- we should have received the MapNotify if one is coming.
- So if we have not got it yet, stop looping.
- Some window managers make their own decisions
- about visibility. */
- if (input_signal_count != count)
- break;
- /* Machines that do polling rather than SIGIO have been observed
- to go into a busy-wait here. So we'll fake an alarm signal
- to let the handler know that there's something to be read.
- We used to raise a real alarm, but it seems that the handler
- isn't always enabled here. This is probably a bug. */
+
+ /* Machines that do polling rather than SIGIO have been
+ observed to go into a busy-wait here. So we'll fake an
+ alarm signal to let the handler know that there's something
+ to be read. We used to raise a real alarm, but it seems
+ that the handler isn't always enabled here. This is
+ probably a bug. */
if (input_polling_used ())
{
- /* It could be confusing if a real alarm arrives while processing
- the fake one. Turn it off and let the handler reset it. */
+ /* It could be confusing if a real alarm arrives while
+ processing the fake one. Turn it off and let the
+ handler reset it. */
alarm (0);
input_poll_signal (0);
}
- /* Once we have handled input events,
- we should have received the MapNotify if one is coming.
- So if we have not got it yet, stop looping.
- Some window managers make their own decisions
- about visibility. */
- if (input_signal_count != count)
- break;
+
+ /* See if a MapNotify event has been processed. */
+ FRAME_SAMPLE_VISIBILITY (f);
}
- FRAME_SAMPLE_VISIBILITY (f);
}
}