Function: window-resize-apply

window-resize-apply is a function defined in window.c.

Signature

(window-resize-apply &optional FRAME HORIZONTAL)

Documentation

Apply requested size values for window-tree of FRAME.

If FRAME is omitted or nil, it defaults to the selected frame.

Optional argument HORIZONTAL omitted or nil means apply requested height values. HORIZONTAL non-nil means apply requested width values.

The requested size values are those set by set-window-new-pixel and set-window-new-normal. This function checks whether the requested values sum up to a valid window layout, recursively assigns the new sizes of all child windows and calculates and assigns the new start positions of these windows.

Return t if the requested values have been applied correctly, nil otherwise.

Note: This function does not check any of window-fixed-size-p, window-min-height or window-min-width. All these checks have to be applied on the Elisp level.

Source Code

// Defined in /usr/src/emacs/src/window.c
{
  struct frame *f = decode_live_frame (frame);
  struct window *r = XWINDOW (FRAME_ROOT_WINDOW (f));
  bool horflag = !NILP (horizontal);

  if (!window_resize_check (r, horflag)
      || (XFIXNUM (r->new_pixel)
	  != (horflag ? r->pixel_width : r->pixel_height)))
    return Qnil;

  block_input ();
  window_resize_apply (r, horflag);

  fset_redisplay (f);

  adjust_frame_glyphs (f);
  unblock_input ();

  return Qt;
}