* window.h (struct window): Drop frozen_window_start_p.
(freeze_window_starts): Drop prototype.
* frame.h (struct frame): New frozen_window_starts flag.
(FRAME_WINDOWS_FROZEN): New macro.
* window.c (freeze_window_start, freeze_window_starts):
Remove.
(select_window, replace_window): Adjust users.
* xdisp.c (resize_mini_window): Use FRAME_WINDOWS_FROZEN.
(window_frozen_p): New function.
(redisplay_window): Use it.
+2013-08-12 Dmitry Antipov <dmantipov@yandex.ru>
+
+ Avoid looping over all frame windows to freeze and unfreeze.
+ * window.h (struct window): Drop frozen_window_start_p.
+ (freeze_window_starts): Drop prototype.
+ * frame.h (struct frame): New frozen_window_starts flag.
+ (FRAME_WINDOWS_FROZEN): New macro.
+ * window.c (freeze_window_start, freeze_window_starts):
+ Remove.
+ (select_window, replace_window): Adjust users.
+ * xdisp.c (resize_mini_window): Use FRAME_WINDOWS_FROZEN.
+ (window_frozen_p): New function.
+ (redisplay_window): Use it.
+
2013-08-12 Paul Eggert <eggert@cs.ucla.edu>
Fix some fd issues when running subprocesses (Bug#15035).
/* Nonzero means that the pointer is invisible. */
unsigned pointer_invisible :1;
+ /* Nonzero means that all windows except mini-window and
+ selected window on this frame have frozen window starts. */
+ unsigned frozen_window_starts : 1;
+
/* Nonzero if we should actually display the scroll bars on this frame. */
enum vertical_scroll_bar_type vertical_scroll_bar_type;
/* Not really implemented. */
#define FRAME_WANTS_MODELINE_P(f) (f)->wants_modeline
+/* Nonzero if all windows except selected window and mini window
+ are frozen on frame F. */
+#define FRAME_WINDOWS_FROZEN(f) (f)->frozen_window_starts
+
/* Nonzero if a size change has been requested for frame F
but not yet really put into effect. This can be true temporarily
when an X event comes in at a bad time. */
static void window_scroll (Lisp_Object, EMACS_INT, bool, int);
static void window_scroll_pixel_based (Lisp_Object, int, bool, int);
static void window_scroll_line_based (Lisp_Object, int, bool, int);
-static int freeze_window_start (struct window *, void *);
static Lisp_Object window_list (void);
static int add_window_to_list (struct window *, void *);
static Lisp_Object next_window (Lisp_Object, Lisp_Object,
CHECK_LIVE_WINDOW (window);
w = XWINDOW (window);
- w->frozen_window_start_p = 0;
/* Make the selected window's buffer current. */
Fset_buffer (w->contents);
wset_window_end_vpos (n, make_number (0));
wset_window_end_pos (n, make_number (0));
n->window_end_valid = 0;
- n->frozen_window_start_p = 0;
}
tem = o->next;
return cont;
}
-
-/* Freeze or unfreeze the window start of W unless it is a
- mini-window or the selected window. FREEZE_P non-null means freeze
- the window start. */
-
-static int
-freeze_window_start (struct window *w, void *freeze_p)
-{
- if (MINI_WINDOW_P (w)
- || (WINDOWP (selected_window) /* Can be nil in corner cases. */
- && (w == XWINDOW (selected_window)
- || (MINI_WINDOW_P (XWINDOW (selected_window))
- && ! NILP (Vminibuf_scroll_window)
- && w == XWINDOW (Vminibuf_scroll_window)))))
- freeze_p = NULL;
-
- w->frozen_window_start_p = freeze_p != NULL;
- return 1;
-}
-
-
-/* Freeze or unfreeze the window starts of all leaf windows on frame
- F, except the selected window and a mini-window. FREEZE_P non-zero
- means freeze the window start. */
-
-void
-freeze_window_starts (struct frame *f, bool freeze_p)
-{
- foreach_window (f, freeze_window_start, freeze_p ? f : 0);
-}
-
-\f
/***********************************************************************
Initialization
***********************************************************************/
Currently only used for menu bar windows of frames. */
unsigned pseudo_window_p : 1;
- /* 1 means the window start of this window is frozen and may not
- be changed during redisplay. If point is not in the window,
- accept that. */
- unsigned frozen_window_start_p : 1;
-
/* Non-zero means fringes are drawn outside display margins.
Otherwise draw them between margin areas and text. */
unsigned fringes_outside_margins : 1;
extern void resize_frame_windows (struct frame *, int, bool);
extern void restore_window_configuration (Lisp_Object);
extern void delete_all_child_windows (Lisp_Object);
-extern void freeze_window_starts (struct frame *, bool);
extern void grow_mini_window (struct window *, int);
extern void shrink_mini_window (struct window *);
extern int window_relative_x_coord (struct window *, enum window_part, int);
if (height > WINDOW_TOTAL_LINES (w))
{
int old_height = WINDOW_TOTAL_LINES (w);
- freeze_window_starts (f, 1);
+
+ FRAME_WINDOWS_FROZEN (f) = 1;
grow_mini_window (w, height - WINDOW_TOTAL_LINES (w));
window_height_changed_p = WINDOW_TOTAL_LINES (w) != old_height;
}
&& (exact_p || BEGV == ZV))
{
int old_height = WINDOW_TOTAL_LINES (w);
- freeze_window_starts (f, 0);
+
+ FRAME_WINDOWS_FROZEN (f) = 0;
shrink_mini_window (w);
window_height_changed_p = WINDOW_TOTAL_LINES (w) != old_height;
}
if (height > WINDOW_TOTAL_LINES (w))
{
int old_height = WINDOW_TOTAL_LINES (w);
- freeze_window_starts (f, 1);
+
+ FRAME_WINDOWS_FROZEN (f) = 1;
grow_mini_window (w, height - WINDOW_TOTAL_LINES (w));
window_height_changed_p = WINDOW_TOTAL_LINES (w) != old_height;
}
else if (height < WINDOW_TOTAL_LINES (w))
{
int old_height = WINDOW_TOTAL_LINES (w);
- freeze_window_starts (f, 0);
+
+ FRAME_WINDOWS_FROZEN (f) = 0;
shrink_mini_window (w);
if (height)
{
- freeze_window_starts (f, 1);
+ FRAME_WINDOWS_FROZEN (f) = 1;
grow_mini_window (w, height - WINDOW_TOTAL_LINES (w));
}
&& (w->column_number_displayed != current_column ()));
}
+/* Nonzero if window start of W is frozen and may not be changed during
+ redisplay. */
+
+static bool
+window_frozen_p (struct window *w)
+{
+ if (FRAME_WINDOWS_FROZEN (XFRAME (WINDOW_FRAME (w))))
+ {
+ Lisp_Object window;
+
+ XSETWINDOW (window, w);
+ if (MINI_WINDOW_P (w))
+ return 0;
+ else if (EQ (window, selected_window))
+ return 0;
+ else if (MINI_WINDOW_P (XWINDOW (selected_window))
+ && EQ (window, Vminibuf_scroll_window))
+ /* This special window can't be frozen too. */
+ return 0;
+ else
+ return 1;
+ }
+ return 0;
+}
+
/***********************************************************************
Mode Lines and Frame Titles
***********************************************************************/
/* Handle case where place to start displaying has been specified,
unless the specified location is outside the accessible range. */
- if (w->force_start || w->frozen_window_start_p)
+ if (w->force_start || window_frozen_p (w))
{
/* We set this later on if we have to adjust point. */
int new_vpos = -1;
goto need_larger_matrices;
}
- if (w->cursor.vpos < 0 && !w->frozen_window_start_p)
+ if (w->cursor.vpos < 0 && !window_frozen_p (w))
{
/* If point does not appear, try to move point so it does
appear. The desired matrix has been built above, so we