Commit edfa7fa0 authored by Dmitry Antipov's avatar Dmitry Antipov

Drop async_visible and async_iconified fields of struct frame.

This is possible because async input is gone; for details, see
http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
* frame.h (struct frame): Remove async_visible and async_iconified
members, convert garbaged to unsigned bitfield.  Adjust comments.
(FRAME_SAMPLE_VISIBILITY): Remove.  Adjust all users.
(SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
* frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
* w32term.c: Ditto.
(w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
properly.  Likewise for obscured.
* xterm.c: Ditto.
(handle_one_xevent): Save visible state go generate ICONIFY_EVENT
properly.
* nsterm.m: Ditto.
(windowDidDeminiaturize): Generate DEICONIFY_EVENT.
parent 5ad86e34
2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
Drop async_visible and async_iconified fields of struct frame.
This is possible because async input is gone; for details, see
http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
* frame.h (struct frame): Remove async_visible and async_iconified
members, convert garbaged to unsigned bitfield. Adjust comments.
(FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
(SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
* frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
* w32term.c: Ditto.
(w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
properly. Likewise for obscured.
* xterm.c: Ditto.
(handle_one_xevent): Save visible state go generate ICONIFY_EVENT
properly.
* nsterm.m: Ditto.
(windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
* insdel.c (prepare_to_modify_buffer): Revert last change as suggested
......
......@@ -500,8 +500,7 @@ make_initial_frame (void)
tty_frame_count = 1;
fset_name (f, build_pure_c_string ("F1"));
f->visible = 1;
f->async_visible = 1;
SET_FRAME_VISIBLE (f, 1);
f->output_method = terminal->type;
f->terminal = terminal;
......@@ -540,8 +539,8 @@ make_terminal_frame (struct terminal *terminal)
fset_name (f, make_formatted_string (name, "F%"pMd, ++tty_frame_count));
f->visible = 1; /* FRAME_SET_VISIBLE wd set frame_garbaged. */
f->async_visible = 1; /* Don't let visible be cleared later. */
SET_FRAME_VISIBLE (f, 1);
f->terminal = terminal;
f->terminal->reference_count++;
#ifdef MSDOS
......@@ -565,7 +564,7 @@ make_terminal_frame (struct terminal *terminal)
/* Set the top frame to the newly created frame. */
if (FRAMEP (FRAME_TTY (f)->top_frame)
&& FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */
SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (f)->top_frame), 2); /* obscured */
FRAME_TTY (f)->top_frame = frame;
......@@ -806,8 +805,8 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
{
if (FRAMEP (FRAME_TTY (XFRAME (frame))->top_frame))
/* Mark previously displayed frame as now obscured. */
XFRAME (FRAME_TTY (XFRAME (frame))->top_frame)->async_visible = 2;
XFRAME (frame)->async_visible = 1;
SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (XFRAME (frame))->top_frame), 2);
SET_FRAME_VISIBLE (XFRAME (frame), 1);
FRAME_TTY (XFRAME (frame))->top_frame = frame;
}
......@@ -914,7 +913,6 @@ candidate_frame (Lisp_Object candidate, Lisp_Object frame, Lisp_Object minibuf)
}
else if (EQ (minibuf, Qvisible))
{
FRAME_SAMPLE_VISIBILITY (c);
if (FRAME_VISIBLE_P (c))
return candidate;
}
......@@ -928,7 +926,6 @@ candidate_frame (Lisp_Object candidate, Lisp_Object frame, Lisp_Object minibuf)
}
else if (XFASTINT (minibuf) == 0)
{
FRAME_SAMPLE_VISIBILITY (c);
if (FRAME_VISIBLE_P (c) || FRAME_ICONIFIED_P (c))
return candidate;
}
......@@ -1052,10 +1049,7 @@ other_visible_frames (FRAME_PTR f)
and note any recent change in visibility. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (XFRAME (this)))
{
x_sync (XFRAME (this));
FRAME_SAMPLE_VISIBILITY (XFRAME (this));
}
x_sync (XFRAME (this));
#endif
if (FRAME_VISIBLE_P (XFRAME (this))
......@@ -1231,7 +1225,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
fset_root_window (f, Qnil);
Vframe_list = Fdelq (frame, Vframe_list);
FRAME_SET_VISIBLE (f, 0);
SET_FRAME_VISIBLE (f, 0);
/* Allow the vector of menu bar contents to be freed in the next
garbage collection. The frame object itself may not be garbage
......@@ -1579,10 +1573,7 @@ If omitted, FRAME defaults to the currently selected frame. */)
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
{
FRAME_SAMPLE_VISIBILITY (f);
x_make_frame_visible (f);
}
x_make_frame_visible (f);
#endif
make_frame_visible_1 (f->root_window);
......@@ -1705,8 +1696,6 @@ currently being displayed on the terminal. */)
{
CHECK_LIVE_FRAME (frame);
FRAME_SAMPLE_VISIBILITY (XFRAME (frame));
if (FRAME_VISIBLE_P (XFRAME (frame)))
return Qt;
if (FRAME_ICONIFIED_P (XFRAME (frame)))
......@@ -2891,7 +2880,6 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
make_formatted_string (buf, "%"pMu, w));
#endif
store_in_alist (alistptr, Qicon_name, f->icon_name);
FRAME_SAMPLE_VISIBILITY (f);
store_in_alist (alistptr, Qvisibility,
(FRAME_VISIBLE_P (f) ? Qt
: FRAME_ICONIFIED_P (f) ? Qicon : Qnil));
......
......@@ -353,46 +353,30 @@ struct frame
unsigned int external_menu_bar : 1;
#endif
/* visible is nonzero if the frame is currently displayed; we check
/* Next two bitfields are mutually exclusive. They might both be
zero if the frame has been made invisible without an icon. */
/* Nonzero if the frame is currently displayed; we check
it to see if we should bother updating the frame's contents.
DON'T SET IT DIRECTLY; instead, use FRAME_SET_VISIBLE.
Note that, since invisible frames aren't updated, whenever a
frame becomes visible again, it must be marked as garbaged. The
FRAME_SAMPLE_VISIBILITY macro takes care of this.
frame becomes visible again, it must be marked as garbaged.
On ttys and on Windows NT/9X, to avoid wasting effort updating
visible frames that are actually completely obscured by other
windows on the display, we bend the meaning of visible slightly:
if greater than 1, then the frame is obscured - we still consider
if equal to 2, then the frame is obscured - we still consider
it to be "visible" as seen from lisp, but we don't bother
updating it. We must take care to garbage the frame when it
ceases to be obscured though.
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.
These two are mutually exclusive. They might both be zero, if the
frame has been made invisible without an icon. */
ceases to be obscured though. See SET_FRAME_VISIBLE below. */
unsigned visible : 2;
unsigned iconified : 1;
/* Let's not use bitfields for volatile variables. */
/* Asynchronous input handlers change these, and
FRAME_SAMPLE_VISIBILITY copies them into visible and iconified.
See FRAME_SAMPLE_VISIBILITY, below. */
volatile char async_visible, async_iconified;
/* Nonzero if the frame is currently iconified. Do not
set this directly, use SET_FRAME_ICONIFIED instead. */
unsigned iconified : 1;
/* Nonzero if this frame should be redrawn. */
volatile char garbaged;
unsigned garbaged : 1;
/* True if frame actually has a minibuffer window on it.
0 if using a minibuffer window that isn't on this frame. */
......@@ -711,7 +695,7 @@ typedef struct frame *FRAME_PTR;
#else
#define FRAME_EXTERNAL_MENU_BAR(f) 0
#endif
#define FRAME_VISIBLE_P(f) ((f)->visible != 0)
#define FRAME_VISIBLE_P(f) (f)->visible
/* Nonzero if frame F is currently visible but hidden. */
#define FRAME_OBSCURED_P(f) ((f)->visible > 1)
......@@ -719,9 +703,10 @@ typedef struct frame *FRAME_PTR;
/* Nonzero if frame F is currently iconified. */
#define FRAME_ICONIFIED_P(f) (f)->iconified
#define FRAME_SET_VISIBLE(f,p) \
((f)->async_visible = (p), FRAME_SAMPLE_VISIBILITY (f))
/* Mark frame F as currently garbaged. */
#define SET_FRAME_GARBAGED(f) (frame_garbaged = 1, f->garbaged = 1)
/* Nonzero if frame F is currently garbaged. */
#define FRAME_GARBAGED_P(f) (f)->garbaged
/* Nonzero means do not allow splitting this frame's window. */
......@@ -866,39 +851,6 @@ typedef struct frame *FRAME_PTR;
#define FRAME_MESSAGE_BUF_SIZE(f) (((int) FRAME_COLS (f)) * 4)
/* 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.
Synchronous code must use the FRAME_SET_VISIBLE macro.
Also, if a frame used to be invisible, but has just become visible,
it must be marked as garbaged, since redisplay hasn't been keeping
up its contents.
Note that a tty frame is visible if and only if it is the topmost
frame. */
#define FRAME_SAMPLE_VISIBILITY(f) \
(((f)->async_visible && (f)->visible != (f)->async_visible) ? \
SET_FRAME_GARBAGED (f) : 0, \
(f)->visible = (f)->async_visible, \
(f)->iconified = (f)->async_iconified)
#define CHECK_FRAME(x) \
CHECK_TYPE (FRAMEP (x), Qframep, x)
......@@ -932,12 +884,24 @@ typedef struct frame *FRAME_PTR;
block_input (); \
if (hlinfo->mouse_face_mouse_frame) \
note_mouse_highlight (hlinfo->mouse_face_mouse_frame, \
hlinfo->mouse_face_mouse_x, \
hlinfo->mouse_face_mouse_y); \
hlinfo->mouse_face_mouse_x, \
hlinfo->mouse_face_mouse_y); \
unblock_input (); \
} \
} while (0)
/* Set visibility of frame F, marking F as garbaged if needed. */
#define SET_FRAME_VISIBLE(f, v) \
(((f)->visible == 0 || ((f)->visible == 2)) \
&& ((v) == 1) ? SET_FRAME_GARBAGED (f) : 0, \
(f)->visible = (eassert (0 <= (v) && (v) <= 2), (v)))
/* Set iconify of frame F. */
#define SET_FRAME_ICONIFIED(f, i) \
(f)->iconified = (eassert (0 <= (i) && (i) <= 1), (i))
extern Lisp_Object Qframep, Qframe_live_p;
extern Lisp_Object Qtty, Qtty_type;
extern Lisp_Object Qtty_color_mode;
......
......@@ -983,7 +983,7 @@ xg_frame_set_char_size (FRAME_PTR f, int cols, int rows)
size as fast as possible.
For unmapped windows, we can set rows/cols. When
the frame is mapped again we will (hopefully) get the correct size. */
if (f->async_visible)
if (FRAME_VISIBLE_P (f))
{
/* Must call this to flush out events */
(void)gtk_events_pending ();
......
......@@ -1000,11 +1000,8 @@ Free a pool and temporary objects it refers to (callable from C)
NSView *view = FRAME_NS_VIEW (f);
check_ns ();
block_input ();
FRAME_SAMPLE_VISIBILITY (f);
if (FRAME_VISIBLE_P (f))
{
[[view window] makeKeyAndOrderFront: NSApp];
}
[[view window] makeKeyAndOrderFront: NSApp];
unblock_input ();
}
......@@ -1093,7 +1090,8 @@ Free a pool and temporary objects it refers to (callable from C)
if (!FRAME_VISIBLE_P (f))
{
EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f);
f->async_visible = 1;
SET_FRAME_VISIBLE (f, 1);
ns_raise_frame (f);
#ifdef NEW_STYLE_FS
......@@ -1123,8 +1121,8 @@ Free a pool and temporary objects it refers to (callable from C)
NSTRACE (x_make_frame_invisible);
check_ns ();
[[view window] orderOut: NSApp];
f->async_visible = 0;
f->async_iconified = 0;
SET_FRAME_VISIBLE (f, 0);
SET_FRAME_ICONIFIED (f, 0);
}
......@@ -1354,7 +1352,9 @@ Free a pool and temporary objects it refers to (callable from C)
{
EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f);
if (! f->async_visible) return;
if (!FRAME_VISIBLE_P (f))
return;
#ifndef NEW_STYLE_FS
if (f->want_fullscreen == FULLSCREEN_BOTH)
{
......@@ -5824,13 +5824,14 @@ - (void)windowDidDeminiaturize: sender
NSTRACE (windowDidDeminiaturize);
if (!emacsframe->output_data.ns)
return;
emacsframe->async_iconified = 0;
emacsframe->async_visible = 1;
SET_FRAME_ICONIFIED (emacsframe, 0);
SET_FRAME_VISIBLE (emacsframe, 1);
windows_or_buffers_changed++;
if (emacs_event)
{
emacs_event->kind = ICONIFY_EVENT;
emacs_event->kind = DEICONIFY_EVENT;
EV_TRAILER ((id)nil);
}
}
......@@ -5841,7 +5842,8 @@ - (void)windowDidExpose: sender
NSTRACE (windowDidExpose);
if (!emacsframe->output_data.ns)
return;
emacsframe->async_visible = 1;
SET_FRAME_VISIBLE (emacsframe, 1);
SET_FRAME_GARBAGED (emacsframe);
if (send_appdefined)
......@@ -5855,8 +5857,8 @@ - (void)windowDidMiniaturize: sender
if (!emacsframe->output_data.ns)
return;
emacsframe->async_iconified = 1;
emacsframe->async_visible = 0;
SET_FRAME_ICONIFIED (emacsframe, 1);
SET_FRAME_VISIBLE (emacsframe, 0);
if (emacs_event)
{
......
......@@ -2374,7 +2374,7 @@ A suspended tty may be resumed by calling `resume-tty' on it. */)
t->display_info.tty->output = 0;
if (FRAMEP (t->display_info.tty->top_frame))
FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0);
SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0);
}
......@@ -2444,7 +2444,7 @@ frame's terminal). */)
get_tty_size (fileno (t->display_info.tty->input), &width, &height);
if (width != old_width || height != old_height)
change_frame_size (f, height, width, 0, 0, 0);
FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
SET_FRAME_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
}
set_tty_hooks (t);
......
......@@ -5943,7 +5943,7 @@ Text larger than the specified size is clipped. */)
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
/* Let redisplay know that we have made the frame visible already. */
f->async_visible = 1;
SET_FRAME_VISIBLE (f, 1);
ShowWindow (FRAME_W32_WINDOW (f), SW_SHOWNOACTIVATE);
}
......
......@@ -4319,24 +4319,25 @@ w32_read_socket (struct terminal *terminal,
DebPrint (("clipped frame %p (%s) got WM_PAINT - ignored\n", f,
SDATA (f->name)));
}
else if (f->async_visible != 1)
else if (FRAME_VISIBLE_P (f) != 1)
{
bool iconified = FRAME_ICONIFIED_P (f);
/* Definitely not obscured, so mark as visible. */
f->async_visible = 1;
f->async_iconified = 0;
SET_FRAME_VISIBLE (f, 1);
SET_FRAME_ICONIFIED (f, 0);
SET_FRAME_GARBAGED (f);
DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f,
SDATA (f->name)));
/* WM_PAINT serves as MapNotify as well, so report
visibility changes properly. */
if (f->iconified)
if (iconified)
{
inev.kind = DEICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
}
else if (! NILP (Vframe_list)
&& ! NILP (XCDR (Vframe_list)))
else if (!NILP (Vframe_list) && !NILP (XCDR (Vframe_list)))
/* Force a redisplay sooner or later to update the
frame titles in case this is the second frame. */
record_asynch_buffer_change ();
......@@ -4379,7 +4380,7 @@ w32_read_socket (struct terminal *terminal,
case WM_SYSKEYDOWN:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f && !f->iconified)
if (f && !FRAME_ICONIFIED_P (f))
{
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
&& !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
......@@ -4404,7 +4405,7 @@ w32_read_socket (struct terminal *terminal,
case WM_CHAR:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f && !f->iconified)
if (f && !FRAME_ICONIFIED_P (f))
{
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
&& !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
......@@ -4482,7 +4483,7 @@ w32_read_socket (struct terminal *terminal,
case WM_APPCOMMAND:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f && !f->iconified)
if (f && !FRAME_ICONIFIED_P (f))
{
if (!hlinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)
&& !EQ (f->tool_bar_window, hlinfo->mouse_face_window))
......@@ -4722,7 +4723,7 @@ w32_read_socket (struct terminal *terminal,
case WM_MOVE:
f = x_window_to_frame (dpyinfo, msg.msg.hwnd);
if (f && !f->async_iconified)
if (f && !FRAME_ICONIFIED_P (f))
{
int x, y;
......@@ -4770,8 +4771,8 @@ w32_read_socket (struct terminal *terminal,
switch (msg.msg.wParam)
{
case SIZE_MINIMIZED:
f->async_visible = 0;
f->async_iconified = 1;
SET_FRAME_VISIBLE (f, 0);
SET_FRAME_ICONIFIED (f, 1);
inev.kind = ICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
......@@ -4779,40 +4780,44 @@ w32_read_socket (struct terminal *terminal,
case SIZE_MAXIMIZED:
case SIZE_RESTORED:
f->async_visible = 1;
f->async_iconified = 0;
{
bool iconified = FRAME_ICONIFIED_P (f);
/* wait_reading_process_output will notice this and update
the frame's display structures. */
SET_FRAME_GARBAGED (f);
SET_FRAME_VISIBLE (f, 1);
SET_FRAME_ICONIFIED (f, 0);
if (f->iconified)
{
int x, y;
/* Reset top and left positions of the Window
here since Windows sends a WM_MOVE message
BEFORE telling us the Window is minimized
when the Window is iconified, with 3000,3000
as the co-ords. */
x_real_positions (f, &x, &y);
f->left_pos = x;
f->top_pos = y;
/* wait_reading_process_output will notice this
and update the frame's display structures. */
SET_FRAME_GARBAGED (f);
inev.kind = DEICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
}
else if (! NILP (Vframe_list)
&& ! NILP (XCDR (Vframe_list)))
/* Force a redisplay sooner or later
to update the frame titles
in case this is the second frame. */
record_asynch_buffer_change ();
if (iconified)
{
int x, y;
/* Reset top and left positions of the Window
here since Windows sends a WM_MOVE message
BEFORE telling us the Window is minimized
when the Window is iconified, with 3000,3000
as the co-ords. */
x_real_positions (f, &x, &y);
f->left_pos = x;
f->top_pos = y;
inev.kind = DEICONIFY_EVENT;
XSETFRAME (inev.frame_or_window, f);
}
else if (! NILP (Vframe_list)
&& ! NILP (XCDR (Vframe_list)))
/* Force a redisplay sooner or later
to update the frame titles
in case this is the second frame. */
record_asynch_buffer_change ();
}
break;
}
}
if (f && !f->async_iconified && msg.msg.wParam != SIZE_MINIMIZED)
if (f && !FRAME_ICONIFIED_P (f) && msg.msg.wParam != SIZE_MINIMIZED)
{
RECT rect;
int rows;
......@@ -5040,12 +5045,13 @@ w32_read_socket (struct terminal *terminal,
continue;
/* Check "visible" frames and mark each as obscured or not.
Note that async_visible is nonzero for unobscured and
obscured frames, but zero for hidden and iconified frames. */
if (FRAME_W32_P (f) && f->async_visible)
Note that visible is nonzero for unobscured and obscured
frames, but zero for hidden and iconified frames. */
if (FRAME_W32_P (f) && FRAME_VISIBLE_P (f))
{
RECT clipbox;
HDC hdc;
bool obscured;
enter_crit ();
/* Query clipping rectangle for the entire window area
......@@ -5059,31 +5065,28 @@ w32_read_socket (struct terminal *terminal,
ReleaseDC (FRAME_W32_WINDOW (f), hdc);
leave_crit ();
if (clipbox.right == clipbox.left
|| clipbox.bottom == clipbox.top)
obscured = FRAME_OBSCURED_P (f);
if (clipbox.right == clipbox.left || clipbox.bottom == clipbox.top)
{
/* Frame has become completely obscured so mark as
such (we do this by setting async_visible to 2 so
that FRAME_VISIBLE_P is still true, but redisplay
will skip it). */
f->async_visible = 2;
/* Frame has become completely obscured so mark as such (we
do this by setting visible to 2 so that FRAME_VISIBLE_P
is still true, but redisplay will skip it). */
SET_FRAME_VISIBLE (f, 2);
if (!FRAME_OBSCURED_P (f))
{
DebPrint (("frame %p (%s) obscured\n", f,
SDATA (f->name)));
}
if (!obscured)
DebPrint (("frame %p (%s) obscured\n", f, SDATA (f->name)));
}
else
{
/* Frame is not obscured, so mark it as such. */
f->async_visible = 1;
SET_FRAME_VISIBLE (f, 1);
if (FRAME_OBSCURED_P (f))
if (obscured)
{
SET_FRAME_GARBAGED (f);
DebPrint (("obscured frame %p (%s) found to be visible\n", f,
SDATA (f->name)));
DebPrint (("obscured frame %p (%s) found to be visible\n",
f, SDATA (f->name)));
/* Force a redisplay sooner or later. */
record_asynch_buffer_change ();
......@@ -5654,7 +5657,7 @@ w32fullscreen_hook (FRAME_PTR f)
{
static int normal_width, normal_height;
if (f->async_visible)
if (FRAME_VISIBLE_P (f))
{
int width, height, top_pos, left_pos, pixel_height, pixel_width;
int cur_w = FRAME_COLS (f), cur_h = FRAME_LINES (f);
......@@ -6023,11 +6026,11 @@ x_make_frame_visible (struct frame *f)
causes unexpected behavior when unminimizing frames that were
previously maximized. But only SW_SHOWNORMAL works properly for
frames that were truely hidden (using make-frame-invisible), so
we need it to avoid Bug#5482. It seems that async_iconified
is only set for minimized windows that are still visible, so
use that to determine the appropriate flag to pass ShowWindow. */
we need it to avoid Bug#5482. It seems that iconified is only
set for minimized windows that are still visible, so use that to
determine the appropriate flag to pass ShowWindow. */
my_show_window (f, FRAME_W32_WINDOW (f),
f->async_iconified ? SW_RESTORE : SW_SHOWNORMAL);
FRAME_ICONIFIED_P (f) ? SW_RESTORE : SW_SHOWNORMAL);
}
/* Synchronize to ensure Emacs knows the frame is visible
......@@ -6066,7 +6069,6 @@ x_make_frame_visible (struct frame *f)
poll_suppress_count = old_poll_suppress_count;
}
}
FRAME_SAMPLE_VISIBILITY (f);
}
}
......@@ -6090,10 +6092,8 @@ x_make_frame_invisible (struct frame *f)
So we can't win using the usual strategy of letting
FRAME_SAMPLE_VISIBILITY set this. So do it by hand,
and synchronize with the server to make sure we agree. */
f->visible = 0;
FRAME_ICONIFIED_P (f) = 0;
f->async_visible = 0;
f->async_iconified = 0;
SET_FRAME_VISIBLE (f, 0);
SET_FRAME_ICONIFIED (f, 0);
unblock_input ();
}
......@@ -6109,7 +6109,7 @@ x_iconify_frame (struct frame *f)
if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f)
FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0;
if (f->async_iconified)
if (FRAME_ICONIFIED_P (f))
return;
block_input ();
......
......@@ -2231,7 +2231,6 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf
}
else if (EQ (all_frames, Qvisible))
{
FRAME_SAMPLE_VISIBILITY (f);
candidate_p = FRAME_VISIBLE_P (f)
&& (FRAME_TERMINAL (XFRAME (w->frame))
== FRAME_TERMINAL (XFRAME (selected_frame)));
......@@ -2239,7 +2238,6 @@ candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf
}
else if (INTEGERP (all_frames) && XINT (all_frames) == 0)
{
FRAME_SAMPLE_VISIBILITY (f);
candidate_p = (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)
#ifdef HAVE_X_WINDOWS
/* Yuck!! If we've just created the frame and the
......
......@@ -9644,8 +9644,7 @@ message3_nolog (Lisp_Object m)