diff options
author | Jim Blandy <jimb@redhat.com> | 1992-12-06 22:17:30 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1992-12-06 22:17:30 +0000 |
commit | 4008ed9b60133b1a83618c394b5b7aab811e7d3c (patch) | |
tree | a284425207b02514b8151f69c6127724b72726de /src/frame.h | |
parent | 21dbc5961499b236cfdb54c974a5984eb5ed2414 (diff) | |
download | emacs-4008ed9b60133b1a83618c394b5b7aab811e7d3c.tar.gz |
* frame.h (struct frame): New fields called async_visible and
async_iconified.
(FRAME_SAMPLE_VISIBILITY): New macro, with MULTI_FRAME and
non-MULTI_FRAME definitions.
Diffstat (limited to 'src/frame.h')
-rw-r--r-- | src/frame.h | 55 |
1 files changed, 50 insertions, 5 deletions
diff --git a/src/frame.h b/src/frame.h index 1a87e6c618d..d15526951e1 100644 --- a/src/frame.h +++ b/src/frame.h @@ -116,14 +116,35 @@ struct frame /* Nonzero if last attempt at redisplay on this frame was preempted. */ char display_preempted; - /* Nonzero if frame is currently displayed. */ - char visible; + /* visible is nonzero if the frame is currently displayed; we check + it to see if we should bother updating the frame's contents. - /* Nonzero if window is currently iconified. - This and visible are mutually exclusive. */ - char iconified; + iconified is nonzero if the frame is currently iconified. + + Asynchronous input handlers should NOT change these directly; + instead, they should change async_visible or async_iconified, and + let the FRAME_SAMPLE_VISIBILITY macro set visible and iconified + at the next redisplay. + + These should probably be considered read-only by everyone except + FRAME_SAMPLE_VISIBILITY. + + This two are mutually exclusive. They might both be zero, if the + frame has been made invisible without an icon. */ + char visible, iconified; + + /* Asynchronous input handlers change these, and + FRAME_SAMPLE_VISIBILITY copies them into visible and iconified. + See FRAME_SAMPLE_VISIBILITY, below. */ +#ifdef __STDC__ + volatile +#endif + char async_visible, async_iconified; /* Nonzero if this frame should be redrawn. */ +#ifdef __STDC__ + volatile +#endif char garbaged; /* True if frame actually has a minibuffer window on it. @@ -200,6 +221,27 @@ typedef struct frame *FRAME_PTR; #define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos #define FRAME_FOCUS_FRAME(f) (f)->focus_frame +/* Emacs's redisplay code could become confused if a frame's + visibility changes at arbitrary times. For example, if a frame is + visible while the desired glyphs are being built, but becomes + invisible before they are updated, then some rows of the + desired_glyphs will be left marked as enabled after redisplay is + complete, which should never happen. The next time the frame + becomes visible, redisplay will probably barf. + + Currently, there are no similar situations involving iconified, but + the principle is the same. + + So instead of having asynchronous input handlers directly set and + clear the frame's visibility and iconification flags, they just set + the async_visible and async_iconified flags; the redisplay code + calls the FRAME_SAMPLE_VISIBILITY macro before doing any redisplay, + which sets visible and iconified from their asynchronous + counterparts. */ +#define FRAME_SAMPLE_VISIBILITY(f) \ + ((f)->visible = (f)->async_visible, \ + (f)->iconified = (f)->async_iconified) + #define CHECK_FRAME(x, i) \ { \ if (! FRAMEP (x)) \ @@ -303,6 +345,9 @@ extern int message_buf_print; #define FRAME_SCROLL_BOTTOM_VPOS(f) (the_only_frame.scroll_bottom_vpos) #define FRAME_FOCUS_FRAME(f) (0) +/* See comments in definition above. */ +#define FRAME_SAMPLE_VISIBILITY(f) (0) + #define CHECK_FRAME(x, i) do; while (0) #define CHECK_LIVE_FRAME(x, y) do; while (0) |