return ON_NOTHING;
/* On vertical window divider (which prevails horizontal
- dividers) ? */
+ dividers)? */
if (!WINDOW_RIGHTMOST_P (w)
&& WINDOW_RIGHT_DIVIDER_WIDTH (w)
&& x >= right_x - WINDOW_RIGHT_DIVIDER_WIDTH (w)
terminals, the vertical line's x coordinate is right_x. */
else if (!w->pseudo_window_p
&& !WINDOW_RIGHTMOST_P (w)
- /* Why check ux if we are not the rightmost window ? Also
- shouldn't a pseudo window always be rightmost ? */
+ /* Why check ux if we are not the rightmost window? Also
+ shouldn't a pseudo window always be rightmost? */
&& x > right_x - ux)
return ON_VERTICAL_BORDER;
(Lisp_Object window, Lisp_Object size, Lisp_Object add)
{
struct window *w = decode_valid_window (window);
+ EMACS_INT size_max = (min (INT_MAX, MOST_POSITIVE_FIXNUM)
+ - (NILP (add) ? 0 : XINT (w->new_pixel)));
- CHECK_NUMBER (size);
+ CHECK_RANGED_INTEGER (size, 0, size_max);
if (NILP (add))
wset_new_pixel (w, size);
else
: FRAME_LINE_HEIGHT (f)));
}
-static int
-window_resize_total_check (struct window *w, int horflag)
-{
- struct frame *f = XFRAME (w->frame);
- struct window *c;
-
- if (WINDOW_VERTICAL_COMBINATION_P (w))
- /* W is a vertical combination. */
- {
- c = XWINDOW (w->contents);
- if (horflag)
- /* All child windows of W must have the same width as W. */
- {
- while (c)
- {
- if (XINT (c->new_pixel) != XINT (w->new_pixel)
-/** || XINT (c->new_total != XINT (w->new_total)) **/
- || !window_resize_check (c, horflag))
- return 0;
-
- c = NILP (c->next) ? 0 : XWINDOW (c->next);
- }
-
- return 1;
- }
- else
- /* The sum of the heights of the child windows of W must equal
- W's height. */
- {
- int sum_of_pixels = 0, sum_of_totals = 0;
-
- while (c)
- {
- if (!window_resize_check (c, horflag))
- return 0;
-
- sum_of_pixels = sum_of_pixels + XINT (c->new_pixel);
-/** sum_of_totals = sum_of_totals + XINT (c->new_total); **/
- c = NILP (c->next) ? 0 : XWINDOW (c->next);
- }
-
- return (sum_of_pixels == XINT (w->new_pixel)
-/** && sum_of_totals == XINT (w->new_total) **/
- );
- }
- }
- else if (WINDOW_HORIZONTAL_COMBINATION_P (w))
- /* W is a horizontal combination. */
- {
- c = XWINDOW (w->contents);
- if (horflag)
- /* The sum of the widths of the child windows of W must equal W's
- width. */
- {
- int sum_of_pixels = 0, sum_of_totals = 0;
-
- while (c)
- {
- if (!window_resize_check (c, horflag))
- return 0;
-
- sum_of_pixels = sum_of_pixels + XINT (c->new_pixel);
- sum_of_totals = sum_of_totals + XINT (c->new_total);
- c = NILP (c->next) ? 0 : XWINDOW (c->next);
- }
-
- return (sum_of_pixels == XINT (w->new_pixel)
-/** && sum_of_totals == XINT (w->new_total) **/
- );
- }
- else
- /* All child windows of W must have the same height as W. */
- {
- while (c)
- {
- if (XINT (c->new_pixel) != XINT (w->new_pixel)
-/** || XINT (c->new_total) != XINT (w->new_total) **/
- || !window_resize_check (c, horflag))
- return 0;
-
- c = NILP (c->next) ? 0 : XWINDOW (c->next);
- }
-
- return 1;
- }
- }
- else
- /* A leaf window. Make sure it's not too small. The following
- hardcodes the values of `window-safe-min-width' (2) and
- `window-safe-min-height' (1) which are defined in window.el. */
- return (XINT (w->new_pixel) >= (horflag
- ? (2 * FRAME_COLUMN_WIDTH (f))
- : FRAME_LINE_HEIGHT (f))
-/** && XINT (w->new_total) >= (horflag ? 2 : 1) **/
- );
-}
/* Set w->pixel_height (w->pixel_height if HORIZONTAL is non-zero) to
w->new_pixel for window W and recursively all child windows of W.
? FRAME_COLUMN_WIDTH (f)
: FRAME_LINE_HEIGHT (f));
}
- else
+ else
{
new_size= (horflag
? size
if (pixelwise)
{
- pixel_height = -XINT (height);
+ pixel_height = min (-XINT (height), INT_MAX - w->pixel_height);
line_height = pixel_height / FRAME_LINE_HEIGHT (f);
}
else
{
- line_height = -XINT (height);
+ line_height = min (-XINT (height),
+ ((INT_MAX - w->pixel_height)
+ / FRAME_LINE_HEIGHT (f)));
pixel_height = line_height * FRAME_LINE_HEIGHT (f);
}
eassert (MINI_WINDOW_P (w));
- height = pixelwise ? w->pixel_height : w->total_lines;
+ height = pixelwise ? w->pixel_height : w->total_lines;
unit = pixelwise ? FRAME_LINE_HEIGHT (f) : 1;
if (height > unit)
{
From `frame-cols' down, the fields are ignored by the GC. */
/* We should be able to do without the following two. */
int frame_cols, frame_lines;
- /* These two should get eventually replaced by their pixelized
+ /* These two should get eventually replaced by their pixel
counterparts. */
int frame_menu_bar_lines, frame_tool_bar_lines;
int frame_text_width, frame_text_height;
- /* These are currently unused. We need them as soon as we pixelize
- them. */
+ /* These are currently unused. We need them as soon as we convert
+ to pixels. */
int frame_menu_bar_height, frame_tool_bar_height;
};
back. We keep track of the prevailing height in these variables. */
int previous_frame_text_height = FRAME_TEXT_HEIGHT (f);
int previous_frame_text_width = FRAME_TEXT_WIDTH (f);
- int previous_frame_menu_bar_height = FRAME_MENU_BAR_HEIGHT (f);
- int previous_frame_tool_bar_height = FRAME_TOOL_BAR_HEIGHT (f);
- int previous_frame_lines = FRAME_LINES (f);
- int previous_frame_cols = FRAME_COLS (f);
+ /* int previous_frame_menu_bar_height = FRAME_MENU_BAR_HEIGHT (f); */
+ /* int previous_frame_tool_bar_height = FRAME_TOOL_BAR_HEIGHT (f); */
+ /* int previous_frame_lines = FRAME_LINES (f); */
+ /* int previous_frame_cols = FRAME_COLS (f); */
int previous_frame_menu_bar_lines = FRAME_MENU_BAR_LINES (f);
int previous_frame_tool_bar_lines = FRAME_TOOL_BAR_LINES (f);
/* This `select_window' calls record_buffer which calls Fdelq which
invokes QUIT, so we do it here at the end rather than earlier,
to minimize the risk of interrupting the Fset_window_configuration
- in an inconsistent state (e.g. before frame-focus redirection is
+ in an inconsistent state (e.g. before frame-focus redirection is
canceled). */
select_window (data->current_window, Qnil, 1);
BVAR (XBUFFER (XWINDOW (selected_window)->contents),