summaryrefslogtreecommitdiff
path: root/src/frame.c
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2014-07-27 15:21:30 +0200
committerMartin Rudalics <rudalics@gmx.at>2014-07-27 15:21:30 +0200
commit3477e27021dbe9366c3c1aaba80feb72f1138b29 (patch)
treec1ebfb6695e8d7f90ddad1a5bfaaf353be677514 /src/frame.c
parent11fb71017b03f01a7e9e2db24973e756a41e16ec (diff)
downloademacs-3477e27021dbe9366c3c1aaba80feb72f1138b29.tar.gz
emacs-3477e27021dbe9366c3c1aaba80feb72f1138b29.tar.bz2
emacs-3477e27021dbe9366c3c1aaba80feb72f1138b29.zip
Complete pixelwise frame/window resizing, add horizontal scrollbar support.
* frame.el (frame-notice-user-settings): Rewrite using frame-initial-frame-tool-bar-height. * menu-bar.el (menu-bar-horizontal-scroll-bar) (menu-bar-no-horizontal-scroll-bar): New functions. (menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal scroll bars. * scroll-bar.el (scroll-bar-lines) (set-horizontal-scroll-bar-mode) (get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode) (scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag) (scroll-bar-toolkit-horizontal-scroll): New functions. (horizontal-scroll-bar-mode) (previous-horizontal-scroll-bar-mode) (horizontal-scroll-bar-mode-explicit): New variables. (horizontal-scroll-bar-mode): New option. (toggle-horizontal-scroll-bar): Do something. (top-level): Bind horizontal-scroll-bar mouse-1. * startup.el (tool-bar-originally-present): Remove variable. (command-line): Don't set tool-bar-originally-present. * window.el (window-min-height): Update doc-string. (window--dump-frame): Dump horizontal scroll bar values. (window--min-size-1): Handle minibuffer window separately. Count in margins and horizontal scroll bar. Return safe value iff IGNORE equals 'safe. (frame-windows-min-size): New function (used by frame resizing routines). (fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal scroll bars. (window--sanitize-window-sizes): New function. (window-split-min-size): Remove. (split-window): Count divider-width. Don't use `window-split-min-size' any more. Reword error messages. Sanitize windows sizes after splitting. * buffer.h (struct buffer): New fields scroll_bar_height and horizontal_scroll_bar_type. * buffer.c (bset_scroll_bar_height) (bset_horizontal_scroll_bar_type): New functions. (Fbuffer_swap_text): Handle old_pointm field. (init_buffer_once): Set defaults for scroll_bar_height and horizontal_scroll_bar_type. (syms_of_buffer): New variables scroll_bar_height and horizontal_scroll_bar_type. * dispextern.h (window_part): Rename ON_SCROLL_BAR to ON_VERTICAL_SCROLL_BAR. Add ON_HORIZONTAL_SCROLL_BAR. (set_vertical_scroll_bar): Remove prototype. (x_change_tool_bar_height): Add prototype. * dispnew.c (adjust_frame_glyphs_for_frame_redisplay) (window_to_frame_vpos, update_frame_1, scrolling, init_display): Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS and FRAME_LINES. (adjust_frame_glyphs_for_window_redisplay): Rearrange lines. (update_window): Start mode_line_row->y after horizontal scroll bar. (change_frame_size_1): Call adjust_frame_size. (init_display): When changing the size of a tty frame do not pass height of menu bar. (Qframe_windows_min_size): New symbol. * frame.h (struct frame): List tool bar fields after menu bar fields. Add official, total_lines, horizontal_scroll_bars, config_scroll_bar_height and config_scroll_bar_lines fields. (FRAME_HAS_HORIZONTAL_SCROLL_BARS) (FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES) (FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS) (FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES) (FRAME_WINDOWS_HEIGHT): New macros. (SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT) (FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES) (FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and horizontal scroll bar. (frame_inhibit_resize, adjust_frame_size) (frame_windows_min_size): Add declarations. (Qscroll_bar_height, Qhorizontal_scroll_bars) (x_set_scroll_bar_default_height, x_set_left_fringe) (x_set_right_fringe, x_set_vertical_scroll_bars) (x_set_horizontal_scroll_bars, x_set_scroll_bar_width) (x_set_scroll_bar_height): Add external declarations. * frame.c: (frame_inhibit_resize, frame_windows_min_size) (adjust_frame_size): New functions. (make_frame): Initial horizontal_scroll_bars field. Use SET_FRAME_LINES. Don't allow horizontal scroll bar in minibuffer window. (make_initial_frame, make_terminal_frame): No horizontal scroll bar in initial and terminal frames. Use adjust_frame_size. (Fframe_total_cols): Fix doc-string. (Fframe_total_lines, Fscroll_bar_height): New Lisp functions. (Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite using adjust_frame_size. (Qscroll_bar_height, Qhorizontal_scroll_bars) (Qframe_windows_min_size): New symbols. (x_set_frame_parameters): Remove call of check_frame_size. (x_report_frame_params): Return scroll_bar_height value. (x_set_left_fringe, x_set_right_fringe): New functions. (adjust_frame_height, x_set_internal_border_width) (x_set_fringe_width): Remove. (x_set_internal_border_width, x_set_vertical_scroll_bars) (x_set_scroll_bar_width, x_set_right_divider_width) (x_set_bottom_divider_width): Rewrite using adjust_frame_size. (x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New functions. (x_figure_window_size): Rewrite to make frame display the expected number of lines. (Vdefault_frame_scroll_bars): Rewrite doc-string. (Vdefault_frame_horizontal_scroll_bars) (Vframe_initial_frame_tool_bar_height) (frame_inhibit_implied_resize): New variables. * fringe.c (compute_fringe_widths): Remove. * gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define. (xg_create_horizontal_scroll_bar) (xg_update_horizontal_scrollbar_pos) (xg_set_toolkit_horizontal_scroll_bar_thumb) (xg_get_default_scrollbar_height) (xg_clear_under_internal_border): Extern. * gtkutil.c (xg_frame_resized): Don't call do_pending_window_change. (xg_frame_set_char_size): Use adjust_frame_size. (style_changed_cb): Call update_theme_scrollbar_height and x_set_scroll_bar_default_height. (x_wm_set_size_hint): Don't call check_frame_size. (update_theme_scrollbar_height) (xg_get_default_scrollbar_height) (xg_create_horizontal_scroll_bar) (xg_update_horizontal_scrollbar_pos) (xg_set_toolkit_horizontal_scroll_bar_thumb): New functions. (xg_create_scroll_bar): Set horizontal slot of bar. (xg_initialize): Call update_theme_scrollbar_height. (xg_clear_under_internal_border): No more static. * insdel.c (adjust_suspend_auto_hscroll): New function. (adjust_markers_for_delete, adjust_markers_for_insert) (adjust_markers_for_replace): Call adjust_suspend_auto_hscroll. * keyboard.c (readable_events, discard_mouse_events) (make_lispy_event): Handle horizontal scroll bar click events. (Fsuspend_emacs): When changing the size of a tty frame do not pass height of menu bar. (Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft) (Qright, Qleftmost, Qrightmost): New symbols. * menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of FRAME_LINES. * minibuf.c (read_minibuf): Initialize suspend_auto_hscroll. * nsfns.m (x_set_internal_border_width): New function. * nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar): Remove extended fringe code. (x_set_window_size, x_new_font): Don't call compute_fringe_widths. * term.c (Fresume_tty): When changing the size of a tty frame do not pass height of menu bar. (clear_tty_hooks, set_tty_hooks): Clear horizontal_scroll_bar_hook. (init_tty): Frame has no horizontal scroll bars. * termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio, scroll_bar_before_handle, scroll_bar_horizontal_handle, scroll_bar_after_handle, scroll_bar_left_arrow, scroll_bar_right_arrow, scroll_bar_to_leftmost and scroll_bar_to_rightmost entries. (enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT (struct terminal): Add set_horizontal_scroll_bar_hook. * w32console.c (initialize_w32_display): Clear horizontal_scroll_bar_hook. * w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of FRAME_X_DISPLAY. (x_clear_under_internal_border, x_set_internal_border_width): New functions. (x_set_menu_bar_lines): Rewrite using frame_inhibit_resize. Set windows_or_buffers_changed when adding the menu bar. (x_set_tool_bar_lines): Rewrite using adjust_frame_size. (x_change_tool_bar_height, x_set_scroll_bar_default_height) (w32_createhscrollbar): New functions. (w32_createscrollbar): Rename to w32_createvscrollbar. (w32_createwindow): Init WND_HSCROLLBAR_INDEX. (w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR. Add WM_EMACS_SHOWCURSOR. (w32_wnd_proc): Handle WM_HSCROLL case. In WM_WINDOWPOSCHANGING case do not artificially impose WM size hints. Handle WM_EMACS_SHOWCURSOR case. Replace WM_EMACS_CREATESCROLLBAR case by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR cases. (my_create_tip_window): Replace WND_SCROLLBAR_INDEX by WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX. (unwind_create_frame_1): Remove. (Fx_create_frame): Make both scrollbars the system standard width and height. Use official field of frame structure to inhibit running window-configuration-change-hook. (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size pixelwise. Handle frame's official field. (w32_frame_parm_handlers): Remove x_set_fringe_width entries. Add x_set_scroll_bar_height, x_set_horizontal_scroll_bars, x_set_left_fringe and x_set_right_fringe. * w32inevt.c (resize_event, maybe_generate_resize_event): Do not pass height of menu bar to change_frame_size. * w32menu.c (set_frame_menubar): Rewrite using frame_inhibit_resize. * w32term.h (struct w32_display_info): Add horizontal_scroll_bar_cursor and cursor_display_counter. (struct scroll_bar): Add horizontal. (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT) (HORIZONTAL_SCROLL_BAR_LEFT_RANGE) (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH) (HORIZONTAL_SCROLL_BAR_LEFT_BORDER) (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER) (HORIZONTAL_SCROLL_BAR_TOP_BORDER) (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER) (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros. (WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define instead of WM_EMACS_CREATESCROLLBAR. (WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of WND_SCROLLBAR_INDEX. * w32term.c (horizontal_scroll_bar_min_handle) (horizontal_scroll_bar_left_border) (horizontal_scroll_bar_right_border): New integers. (x_set_frame_alpha): Replace x_highlight_frame by w32_focus_frame. (x_window_to_scroll_bar): New argument "type". Update callers accordingly. (w32_set_horizontal_scroll_bar_thumb) (x_horizontal_scroll_bar_report_motion) (w32_set_horizontal_scroll_bar) (w32_horizontal_scroll_bar_handle_click) (x_horizontal_scroll_bar_report_motion): New functions. (w32_mouse_position): Discriminate horizontal and vertical scrollbar cases. (my_create_scrollbar): Replace with two new functions my_create_vscrollbar and my_create_hscrollbar. (x_scroll_bar_create): New argument "horizontal". Update callers accordingly. (x_scroll_bar_remove, w32_condemn_scroll_bars) (w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal scroll bar case. (w32_read_socket): Handle WM_HSCROLL cae. (x_new_font): Don't recompute fringe widths. Use frame_inhibit_resize. Calculate new menu bar height iff we build without toolkit. Always clear under internal border. (x_set_window_size): Don't check frame size or recompute fringes. Reset fullscreen status before applying sizes. Always resize as requested by pixelwise argument. Don't call do_pending_window_change. (x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT. (w32_initialize_display_info): Initialize dpyinfo's horizontal_scroll_bar_cursor entry. (w32_create_terminal): Add set_horizontal_scroll_bar_hook. (w32_initialize): Init horizontal_scroll_bar_min_handle and horizontal_scroll_bar_left_border. (w32fullscreen_hook): Intermittently resize window to normal when switching from fullscreen to maximized state. (run_window_configuration_change_hook): Don't run it if frame is not official yet. (unwind_change_frame): Remove. (Fset_window_configuration): Rewrite using frame's official field. * widget.c (set_frame_size): Don't call compute_fringe_widths. (EmacsFrameSetCharSize): Obey frame_inhibit_resize. * window.h (struct window): New fields old_pointm, horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole, scroll_bar_height and suspend_auto_hscroll. (wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type): New functions. (sanitize_window_sizes): Extern. (MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P) (WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR) (WINDOW_CONFIG_SCROLL_BAR_HEIGHT) (WINDOW_CONFIG_SCROLL_BAR_LINES) (WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New macros. (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS) (WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros. (WINDOW_VERTICAL_SCROLL_BAR_TYPE) (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT) (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT) (WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite. (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT) (WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height. * window.c (wset_old_pointm, Fwindow_scroll_bar_height) (Fwindow_old_point, sanitize_window_sizes): New functions. (Qwindow_sanitize_window_sizes): New symbol. (window_body_height): Count in horizontal scroll bar. (set_window_hscroll, Fscroll_left, Fscroll_right): Set suspend_auto_hscroll slot. (Fwindow_inside_edges): Count fringes pixelwise. (coordinates_in_window, Fcoordinates_in_window_p): Consider horizontal scroll bar. (check_frame_size, adjust_window_margins): Remove functions and corresponding calls. (set_window_buffer): Initialize old_pointm and horizontal scroll bars. (temp_output_buffer_show): Reset hscroll related fields. Initialize old_pointm. (make_parent_window): Initialize old_pointm. (make_window): Initialize old_pointm, horizontal scroll bar type, and scroll bar height. (resize_frame_windows): Don't count top margin in new sizes. Don't use safe sizes when shrinking a frame; let the window manager do the clipping. (Fsplit_window_internal): Inherit horizontal scroll bar type and height. (Fdelete_window_internal): Unchain old_pointm marker. (window_scroll_pixel_based, Fscroll_other_window): Adjust old_pointm. (Fwindow_text_width, Fwindow_text_height): New argument "pixelwise". (struct saved_window): New fields, old_pointm, hscroll_whole, suspend_auto_hscroll, scroll_bar_height and horizontal_scroll_bar_type. (Fset_window_configuration, save_window_save): Set new fields of saved_window. (apply_window_adjustment): Don't call adjust_window_margins. (set_window_margins): Don't change margins if new sizes don't fit into window. (set_window_scroll_bars): New argument "horizontal_type". Handle horizontal scroll bars. Don't change scroll bars if they don't fit into window. (Fset_window_scroll_bars): New argument "horizontal_type". (Fwindow_scroll_bars): Return values for horizontal scroll bars. (compare_window_configurations): Compare horizontal scroll bar settings. * xdisp.c (window_text_bottom_y, window_box_height): Count in horizontal scroll bar height. (pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES instead of FRAME_LINES. (remember_mouse_glyph): Case ON_SCROLL_BAR changed to ON_VERTICAL_SCROLL_BAR. (with_echo_area_buffer): Initialize old_pointm. (with_echo_area_buffer_unwind_data): Store old_pointm values in vector. (unwind_with_echo_area_buffer): Handle old_pointm. (update_tool_bar): Set do_update when the tool bar window has at least one line (since this is what the user sets). (MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro. (redisplay_tool_bar): Return early when toolbar has zero lines. Call x_change_tool_bar_height. Don't use max_tool_bar_height. (hscroll_window_tree): Handle suspension of auto_hscroll and old_pointm. (set_horizontal_scroll_bar): New function. (redisplay_window): Set ignore_mouse_drag_p when tool bar has more than one line. Handle horizontal scroll bars. (note_mouse_highlight): Handle horizontal scrol bars. (expose_frame): Set dimensions of XRectangle from frame's text sizes. (Vvoid_text_area_pointer): Update doc-string. * xfns.c (x_set_menu_bar_lines): Use adjust_frame_size. (x_change_tool_bar_height, x_set_scroll_bar_default_height) (x_set_internal_border_width): New functions. (x_set_tool_bar_lines): Call x_change_tool_bar_height. (unwind_create_frame_1): Remove. (Fx_create_frame): Handle horizontal scroll bars. Use official field of frame structure to inhibit running window-configuration-change-hook. (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size pixelwise. Handle frame's official field. (x_frame_parm_handlers): Add x_set_scroll_bar_height, x_set_horizontal_scroll_bars, x_set_left_fringe, x_set_right_fringe. * xmenu.c (update_frame_menubar, free_frame_menubar): Use adjust_frame_size. * xterm.h (struct x_display_info): Add horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar slots. (struct scroll_bar): Add horizontal slot. (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT) (HORIZONTAL_SCROLL_BAR_LEFT_RANGE) (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros. (HORIZONTAL_SCROLL_BAR_LEFT_BORDER) (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER) (HORIZONTAL_SCROLL_BAR_TOP_BORDER) (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER) (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define. (x_clear_under_internal_border): Remove. * xterm.c (XTmouse_position): Handle horizontal scroll bars. (x_window_to_scroll_bar): New argument TYPE. Update callers. (x_send_scroll_bar_event, x_scroll_bar_create): New arguments HORIZONTAL. Update callers. (horizontal_action_hook_id): New action hook id. (x_horizontal_scroll_bar_to_input_event) (x_create_horizontal_toolkit_scroll_bar) (xt_horizontal_action_hook) (x_set_toolkit_horizontal_scroll_bar_thumb) (XTset_horizontal_scroll_bar, x_net_wm_state) (x_horizontal_scroll_bar_report_motion): New functions. (xg_scroll_callback, x_scroll_bar_handle_click): Handle horizontal scroll bars. (SCROLL_BAR_HORIZONTAL_NAME): Define. (XTset_vertical_scroll_bar): Attempt to clear areas not covered by scroll bar. (XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite. Handle horizontal scroll bars. (handle_one_xevent): Handle horizontal scroll bar events. Call x_net_wm_state. (x_set_window_size_1, x_wm_set_size_hint): Don't call check_frame_size. (x_set_window_size): Don't call check_frame_size and do_pending_window_change. (x_term_init): Init horizontal_scroll_bar_cursor display info. (x_create_terminal): Add set_horizontal_scroll_bar_hook. (x_scroll_bar_set_handle): Add some checks when calling x_clear_area.
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c809
1 files changed, 556 insertions, 253 deletions
diff --git a/src/frame.c b/src/frame.c
index 80046bee788..0501b1e2c9c 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -85,6 +85,7 @@ Lisp_Object Qright_divider_width, Qbottom_divider_width;
Lisp_Object Qmouse_color;
Lisp_Object Qminibuffer;
Lisp_Object Qscroll_bar_width, Qvertical_scroll_bars;
+Lisp_Object Qscroll_bar_height, Qhorizontal_scroll_bars;
Lisp_Object Qvisibility;
Lisp_Object Qscroll_bar_foreground, Qscroll_bar_background;
Lisp_Object Qscreen_gamma;
@@ -116,7 +117,7 @@ Lisp_Object Qface_set_after_frame_default;
static Lisp_Object Qfocus_in_hook;
static Lisp_Object Qfocus_out_hook;
static Lisp_Object Qdelete_frame_functions;
-
+static Lisp_Object Qframe_windows_min_size;
static Lisp_Object Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource;
/* The currently selected frame. */
@@ -193,6 +194,48 @@ check_window_system (struct frame *f)
: "Window system is not in use or not initialized");
}
+
+/* Return the value of frame parameter PROP in frame FRAME. */
+#ifdef HAVE_WINDOW_SYSTEM
+Lisp_Object
+get_frame_param (register struct frame *frame, Lisp_Object prop)
+{
+ register Lisp_Object tem;
+
+ tem = Fassq (prop, frame->param_alist);
+ if (EQ (tem, Qnil))
+ return tem;
+ return Fcdr (tem);
+}
+#endif
+
+
+/* Return 1 if `frame-inhibit-implied-resize' is non-nil or fullscreen
+ state of frame F would be affected by a vertical (horizontal if
+ HORIZONTAL is true) resize. */
+bool
+frame_inhibit_resize (struct frame *f, bool horizontal)
+{
+
+ return (frame_inhibit_implied_resize
+ || !NILP (get_frame_param (f, Qfullscreen)));
+}
+
+#if 0
+bool
+frame_inhibit_resize (struct frame *f, bool horizontal)
+{
+ Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
+
+ return (frame_inhibit_implied_resize
+ || EQ (fullscreen, Qfullboth)
+ || EQ (fullscreen, Qfullscreen)
+ || EQ (fullscreen, Qmaximized)
+ || (horizontal && EQ (fullscreen, Qfullwidth))
+ || (!horizontal && EQ (fullscreen, Qfullheight)));
+}
+#endif
+
static void
set_menu_bar_lines_1 (Lisp_Object window, int n)
{
@@ -324,6 +367,247 @@ predicates which report frame's specific UI-related capabilities. */)
return type;
}
+int
+frame_windows_min_size (Lisp_Object frame, Lisp_Object horizontal, Lisp_Object pixelwise)
+{
+ return XINT (call3 (Qframe_windows_min_size, frame, horizontal, pixelwise));
+}
+
+
+/* Make sure windows sizes of frame F are OK. new_width and new_height
+ are in pixels. A value of -1 means no change is requested for that
+ size (but the frame may still have to be resized to accomodate
+ windows with their minimum sizes.
+
+ The argument INHIBIT can assume the following values:
+
+ 0 means to unconditionally call x_set_window_size even if sizes
+ apparently do not change. Fx_create_frame uses this to pass the
+ initial size to the window manager.
+
+ 1 means to call x_set_window_size iff the pixel size really changes.
+ Fset_frame_size, Fset_frame_height, ... use this.
+
+ 2 means to unconditionally call x_set_window_size provided
+ frame_inhibit_resize allows it. The menu bar code uses this.
+
+ 3 means call x_set_window_size iff window minimum sizes must be
+ preserved or frame_inhibit_resize allows it, x_set_left_fringe,
+ x_set_scroll_bar_width, ... use this.
+
+ 4 means call x_set_window_size iff window minimum sizes must be
+ preserved. x_set_tool_bar_lines, x_set_right_divider_width, ... use
+ this. BUT maybe the toolbar code shouldn't ....
+
+ 5 means to never call x_set_window_size. change_frame_size uses
+ this.
+
+ For 2 and 3 note that if frame_inhibit_resize inhibits resizing and
+ minimum sizes are not violated no internal resizing takes place
+ either. For 2, 3, 4 and 5 note that even if no x_set_window_size
+ call is issued, window sizes may have to be adjusted in order to
+ support minimum size constraints for the frame's windows.
+
+ PRETEND is as for change_frame_size. */
+void
+adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit, bool pretend)
+{
+ int unit_width = FRAME_COLUMN_WIDTH (f);
+ int unit_height = FRAME_LINE_HEIGHT (f);
+ int old_pixel_width = FRAME_PIXEL_WIDTH (f);
+ int old_pixel_height = FRAME_PIXEL_HEIGHT (f);
+ int new_pixel_width, new_pixel_height;
+ /* The following two values are calculated from the old frame pixel
+ sizes and any "new" settings for tool bar, menu bar and internal
+ borders. We do it this way to detect whether we have to call
+ x_set_window_size as consequence of the new settings. */
+ int windows_width = FRAME_WINDOWS_WIDTH (f);
+ int windows_height = FRAME_WINDOWS_HEIGHT (f);
+ int min_windows_width, min_windows_height;
+ /* These are a bit tedious, maybe we should use a macro. */
+ struct window *r = XWINDOW (FRAME_ROOT_WINDOW (f));
+ int old_windows_width = WINDOW_PIXEL_WIDTH (r);
+ int old_windows_height
+ = (WINDOW_PIXEL_HEIGHT (r)
+ + (FRAME_HAS_MINIBUF_P (f)
+ ? WINDOW_PIXEL_HEIGHT (XWINDOW (FRAME_MINIBUF_WINDOW (f)))
+ : 0));
+ int new_windows_width, new_windows_height;
+ int old_text_width = FRAME_TEXT_WIDTH (f);
+ int old_text_height = FRAME_TEXT_HEIGHT (f);
+ /* If a size is < 0 use the old value. */
+ int new_text_width = (new_width >= 0) ? new_width : old_text_width;
+ int new_text_height = (new_height >= 0) ? new_height : old_text_height;
+ int new_cols, new_lines;
+ bool inhibit_horizontal, inhibit_vertical;
+ Lisp_Object frame;
+
+ XSETFRAME (frame, f);
+ /* The following two values are calculated from the old window body
+ sizes and any "new" settings for scroll bars, dividers, fringes and
+ margins (though the latter should have been processed already). */
+ min_windows_width = frame_windows_min_size (frame, Qt, Qt);
+ min_windows_height = frame_windows_min_size (frame, Qnil, Qt);
+
+ if (inhibit >= 2 && inhibit <= 4)
+ /* If INHIBIT is in [2..4] inhibit if the "old" window sizes stay
+ within the limits and either frame_inhibit_resize tells us to do
+ so or INHIBIT equals 4. */
+ {
+ inhibit_horizontal = ((windows_width >= min_windows_width
+ && (inhibit == 4 || frame_inhibit_resize (f, true)))
+ ? true : false);
+ inhibit_vertical = ((windows_height >= min_windows_height
+ && (inhibit == 4 || frame_inhibit_resize (f, false)))
+ ? true : false);
+ }
+ else
+ /* Otherwise inhibit if INHIBIT equals 5. */
+ inhibit_horizontal = inhibit_vertical = inhibit == 5;
+
+ new_pixel_width = ((inhibit_horizontal && (inhibit < 5))
+ ? old_pixel_width
+ : max (FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width),
+ min_windows_width
+ + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)));
+ new_windows_width = new_pixel_width - 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
+ new_text_width = FRAME_PIXEL_TO_TEXT_WIDTH (f, new_pixel_width);
+ new_cols = new_text_width / unit_width;
+
+ new_pixel_height = ((inhibit_vertical && (inhibit < 5))
+ ? old_pixel_height
+ : max (FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height),
+ min_windows_height
+ + FRAME_TOP_MARGIN_HEIGHT (f)
+ + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)));
+ new_windows_height = (new_pixel_height
+ - FRAME_TOP_MARGIN_HEIGHT (f)
+ - 2 * FRAME_INTERNAL_BORDER_WIDTH (f));
+ new_text_height = FRAME_PIXEL_TO_TEXT_HEIGHT (f, new_pixel_height);
+ new_lines = new_text_height / unit_height;
+
+#ifdef HAVE_WINDOW_SYSTEM
+ if (FRAME_X_WINDOW (f)
+ && f->official
+ && ((!inhibit_horizontal
+ && (new_pixel_width != old_pixel_width
+ || inhibit == 0 || inhibit == 2))
+ || (!inhibit_vertical
+ && (new_pixel_height != old_pixel_height
+ || inhibit == 0 || inhibit == 2))))
+ /* We are either allowed to change the frame size or the minimum
+ sizes request such a change. Do not care for fixing minimum
+ sizes here, we do that eventually when we're called from
+ change_frame_size. */
+ {
+ /* Make sure we respect fullheight and fullwidth. */
+ if (inhibit_horizontal)
+ new_text_width = old_text_width;
+ else if (inhibit_vertical)
+ new_text_height = old_text_height;
+
+ x_set_window_size (f, 0, new_text_width, new_text_height, 1);
+ f->resized_p = true;
+
+ return;
+ }
+#endif
+
+ if (new_text_width == old_text_width
+ && new_text_height == old_text_height
+ && new_windows_width == old_windows_width
+ && new_windows_height == old_windows_height
+ && new_pixel_width == old_pixel_width
+ && new_pixel_height == old_pixel_height)
+ /* No change. Sanitize window sizes and return. */
+ {
+ sanitize_window_sizes (frame, Qt);
+ sanitize_window_sizes (frame, Qnil);
+
+ return;
+ }
+
+ block_input ();
+
+#ifdef MSDOS
+ /* We only can set screen dimensions to certain values supported
+ by our video hardware. Try to find the smallest size greater
+ or equal to the requested dimensions. */
+ dos_set_window_size (&new_lines, &new_cols);
+#endif
+
+ if (new_windows_width != old_windows_width)
+ {
+ resize_frame_windows (f, new_windows_width, 1, 1);
+
+ /* MSDOS frames cannot PRETEND, as they change frame size by
+ manipulating video hardware. */
+ if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
+ FrameCols (FRAME_TTY (f)) = new_cols;
+
+#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
+ if (WINDOWP (f->tool_bar_window))
+ {
+ XWINDOW (f->tool_bar_window)->pixel_width = new_windows_width;
+ XWINDOW (f->tool_bar_window)->total_cols
+ = new_windows_width / unit_width;
+ }
+#endif
+ }
+
+ if (new_windows_height != old_windows_height
+ /* When the top margin has changed we have to recalculate the top
+ edges of all windows. No such calculation is necessary for the
+ left edges. */
+ || WINDOW_TOP_PIXEL_EDGE (r) != FRAME_TOP_MARGIN_HEIGHT (f))
+ {
+ resize_frame_windows (f, new_windows_height, 0, 1);
+
+ /* MSDOS frames cannot PRETEND, as they change frame size by
+ manipulating video hardware. */
+ if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
+ FrameRows (FRAME_TTY (f)) = new_lines;
+ }
+
+ /* Assign new sizes. */
+ FRAME_TEXT_WIDTH (f) = new_text_width;
+ FRAME_TEXT_HEIGHT (f) = new_text_height;
+ FRAME_PIXEL_WIDTH (f) = new_pixel_width;
+ FRAME_PIXEL_HEIGHT (f) = new_pixel_height;
+ SET_FRAME_COLS (f, new_cols);
+ SET_FRAME_LINES (f, new_lines);
+
+ {
+ struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
+ int text_area_x, text_area_y, text_area_width, text_area_height;
+
+ window_box (w, TEXT_AREA, &text_area_x, &text_area_y, &text_area_width,
+ &text_area_height);
+ if (w->cursor.x >= text_area_x + text_area_width)
+ w->cursor.hpos = w->cursor.x = 0;
+ if (w->cursor.y >= text_area_y + text_area_height)
+ w->cursor.vpos = w->cursor.y = 0;
+ }
+
+ /* Sanitize window sizes. */
+ sanitize_window_sizes (frame, Qt);
+ sanitize_window_sizes (frame, Qnil);
+
+ adjust_frame_glyphs (f);
+ calculate_costs (f);
+ SET_FRAME_GARBAGED (f);
+
+ /* A frame was "resized" if one of its pixelsizes changed, even if its
+ X window wasn't resized at all. */
+ f->resized_p = (new_pixel_width != old_pixel_width
+ || new_pixel_height != old_pixel_height);
+
+ unblock_input ();
+
+ run_window_configuration_change_hook (f);
+}
+
+
struct frame *
make_frame (bool mini_p)
{
@@ -349,10 +633,12 @@ make_frame (bool mini_p)
f->wants_modeline = true;
f->redisplay = true;
f->garbaged = true;
+ f->official = false;
f->column_width = 1; /* !FRAME_WINDOW_P value. */
f->line_height = 1; /* !FRAME_WINDOW_P value. */
#ifdef HAVE_WINDOW_SYSTEM
f->vertical_scroll_bar_type = vertical_scroll_bar_none;
+ f->horizontal_scroll_bars = false;
f->want_fullscreen = FULLSCREEN_NONE;
#if ! defined (USE_GTK) && ! defined (HAVE_NS)
f->last_tool_bar_item = -1;
@@ -382,10 +668,10 @@ make_frame (bool mini_p)
/* 10 is arbitrary,
just so that there is "something there."
- Correct size will be set up later with change_frame_size. */
+ Correct size will be set up later with adjust_frame_size. */
SET_FRAME_COLS (f, 10);
- FRAME_LINES (f) = 10;
+ SET_FRAME_LINES (f, 10);
SET_FRAME_WIDTH (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f));
SET_FRAME_HEIGHT (f, FRAME_LINES (f) * FRAME_LINE_HEIGHT (f));
@@ -423,11 +709,15 @@ make_frame (bool mini_p)
}
if (mini_p)
- set_window_buffer (mini_window,
- (NILP (Vminibuffer_list)
- ? get_minibuffer (0)
- : Fcar (Vminibuffer_list)),
- 0, 0);
+ {
+ set_window_buffer (mini_window,
+ (NILP (Vminibuffer_list)
+ ? get_minibuffer (0)
+ : Fcar (Vminibuffer_list)),
+ 0, 0);
+ /* No horizontal scroll bars in minibuffers. */
+ wset_horizontal_scroll_bar (mw, Qnil);
+ }
fset_root_window (f, root_window);
fset_selected_window (f, root_window);
@@ -573,6 +863,7 @@ make_initial_frame (void)
#ifdef HAVE_WINDOW_SYSTEM
f->vertical_scroll_bar_type = vertical_scroll_bar_none;
+ FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = false;
#endif
/* The default value of menu-bar-mode is t. */
@@ -625,6 +916,7 @@ make_terminal_frame (struct terminal *terminal)
#ifdef HAVE_WINDOW_SYSTEM
f->vertical_scroll_bar_type = vertical_scroll_bar_none;
+ FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = false;
#endif
FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1;
@@ -748,7 +1040,7 @@ affects all frames on the same terminal device. */)
{
int width, height;
get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height);
- change_frame_size (f, width, height, 0, 0, 0, 0);
+ adjust_frame_size (f, width, height, 5, 0);
}
adjust_frame_glyphs (f);
@@ -1983,21 +2275,6 @@ If there is no window system support, this function does nothing. */)
}
-/* Return the value of frame parameter PROP in frame FRAME. */
-
-#ifdef HAVE_WINDOW_SYSTEM
-Lisp_Object
-get_frame_param (register struct frame *frame, Lisp_Object prop)
-{
- register Lisp_Object tem;
-
- tem = Fassq (prop, frame->param_alist);
- if (EQ (tem, Qnil))
- return tem;
- return Fcdr (tem);
-}
-#endif
-
/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */
void
@@ -2240,7 +2517,7 @@ If FRAME is omitted or nil, return information on the currently selected frame.
? (f->new_pixelwise
? (f->new_height / FRAME_LINE_HEIGHT (f))
: f->new_height)
- : FRAME_LINES (f)) - FRAME_TOP_MARGIN (f);
+ : FRAME_LINES (f));
store_in_alist (&alist, Qheight, make_number (height));
width = (f->new_width
? (f->new_pixelwise
@@ -2511,12 +2788,19 @@ DEFUN ("frame-text-lines", Fframe_text_lines, Sframe_text_lines, 0, 1, 0,
}
DEFUN ("frame-total-cols", Fframe_total_cols, Sframe_total_cols, 0, 1, 0,
- doc: /* Return total columns of FRAME. */)
+ doc: /* Return number of total columns of FRAME. */)
(Lisp_Object frame)
{
return make_number (FRAME_TOTAL_COLS (decode_any_frame (frame)));
}
+DEFUN ("frame-total-lines", Fframe_total_lines, Sframe_total_lines, 0, 1, 0,
+ doc: /* Return number of total lines of FRAME. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_TOTAL_LINES (decode_any_frame (frame)));
+}
+
DEFUN ("frame-text-width", Fframe_text_width, Sframe_text_width, 0, 1, 0,
doc: /* Return text area width of FRAME in pixels. */)
(Lisp_Object frame)
@@ -2538,6 +2822,13 @@ DEFUN ("frame-scroll-bar-width", Fscroll_bar_width, Sscroll_bar_width, 0, 1, 0,
return make_number (FRAME_SCROLL_BAR_AREA_WIDTH (decode_any_frame (frame)));
}
+DEFUN ("frame-scroll-bar-height", Fscroll_bar_height, Sscroll_bar_height, 0, 1, 0,
+ doc: /* Return scroll bar height of FRAME in pixels. */)
+ (Lisp_Object frame)
+{
+ return make_number (FRAME_SCROLL_BAR_AREA_HEIGHT (decode_any_frame (frame)));
+}
+
DEFUN ("frame-fringe-width", Ffringe_width, Sfringe_width, 0, 1, 0,
doc: /* Return fringe width of FRAME in pixels. */)
(Lisp_Object frame)
@@ -2566,20 +2857,6 @@ DEFUN ("frame-bottom-divider-width", Fbottom_divider_width, Sbottom_divider_widt
return make_number (FRAME_BOTTOM_DIVIDER_WIDTH (decode_any_frame (frame)));
}
-/* For requested height in *HEIGHTP, calculate new height of frame F in
- character units and return true if actual height should be changed. */
-
-static bool
-adjust_frame_height (struct frame *f, int *heightp)
-{
- if (FRAME_LINES (f) - FRAME_TOP_MARGIN (f) != *heightp)
- {
- *heightp += FRAME_TOP_MARGIN (f);
- return 1;
- }
- return 0;
-}
-
DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 4, 0,
doc: /* Specify that the frame FRAME has HEIGHT text lines.
Optional third arg PRETEND non-nil means that redisplay should use
@@ -2588,33 +2865,17 @@ not be changed. Optional fourth argument PIXELWISE non-nil means that
FRAME should be HEIGHT pixels high. */)
(Lisp_Object frame, Lisp_Object height, Lisp_Object pretend, Lisp_Object pixelwise)
{
- register struct frame *f = decode_live_frame (frame);
+ struct frame *f = decode_live_frame (frame);
+ int pixel_height;
CHECK_TYPE_RANGED_INTEGER (int, height);
- /* I think this should be done with a hook. */
-#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (f))
- {
- if (NILP (pixelwise))
- {
- int h = XINT (height);
-
- if (adjust_frame_height (f, &h))
- x_set_window_size (f, 1, FRAME_COLS (f), h, 0);
+ pixel_height = (!NILP (pixelwise)
+ ? XINT (height)
+ : XINT (height) * FRAME_LINE_HEIGHT (f));
+ if (pixel_height != FRAME_TEXT_HEIGHT (f))
+ adjust_frame_size (f, -1, pixel_height, 1, !NILP (pretend));
- do_pending_window_change (0);
- }
- else if (XINT (height) != FRAME_TEXT_HEIGHT (f))
- {
- x_set_window_size (f, 1, FRAME_TEXT_WIDTH (f), XINT (height), 1);
- do_pending_window_change (0);
- }
- }
- else
-#endif
- change_frame_size (f, 0, XINT (height), !NILP (pretend), 0, 0,
- NILP (pixelwise) ? 0 : 1);
return Qnil;
}
@@ -2626,31 +2887,17 @@ be changed. Optional fourth argument PIXELWISE non-nil means that FRAME
should be WIDTH pixels wide. */)
(Lisp_Object frame, Lisp_Object width, Lisp_Object pretend, Lisp_Object pixelwise)
{
- register struct frame *f = decode_live_frame (frame);
+ struct frame *f = decode_live_frame (frame);
+ int pixel_width;
CHECK_TYPE_RANGED_INTEGER (int, width);
- /* I think this should be done with a hook. */
-#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (f))
- {
- if (NILP (pixelwise))
- {
- if (XINT (width) != FRAME_COLS (f))
- x_set_window_size (f, 1, XINT (width), FRAME_LINES (f), 0);
+ pixel_width = (!NILP (pixelwise)
+ ? XINT (width)
+ : XINT (width) * FRAME_COLUMN_WIDTH (f));
+ if (pixel_width != FRAME_TEXT_WIDTH (f))
+ adjust_frame_size (f, pixel_width, -1, 1, !NILP (pretend));
- do_pending_window_change (0);
- }
- else if (XINT (width) != FRAME_TEXT_WIDTH (f))
- {
- x_set_window_size (f, 1, XINT (width), FRAME_TEXT_HEIGHT (f), 1);
- do_pending_window_change (0);
- }
- }
- else
-#endif
- change_frame_size (f, XINT (width), 0, !NILP (pretend), 0, 0,
- NILP (pixelwise) ? 0 : 1);
return Qnil;
}
@@ -2659,34 +2906,22 @@ DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 4, 0,
Optional argument PIXELWISE non-nil means to measure in pixels. */)
(Lisp_Object frame, Lisp_Object width, Lisp_Object height, Lisp_Object pixelwise)
{
- register struct frame *f = decode_live_frame (frame);
+ struct frame *f = decode_live_frame (frame);
+ int pixel_width, pixel_height;
CHECK_TYPE_RANGED_INTEGER (int, width);
CHECK_TYPE_RANGED_INTEGER (int, height);
- /* I think this should be done with a hook. */
-#ifdef HAVE_WINDOW_SYSTEM
- if (FRAME_WINDOW_P (f))
- {
- int h = XINT (height);
-
- if (!NILP (pixelwise)
- ? (XINT (width) != FRAME_TEXT_WIDTH (f)
- || h != FRAME_TEXT_HEIGHT (f)
- || f->new_height || f->new_width)
- : (adjust_frame_height (f, &h)
- || XINT (width) != FRAME_COLS (f)
- || f->new_height || f->new_width))
- {
- x_set_window_size (f, 1, XINT (width), h,
- NILP (pixelwise) ? 0 : 1);
- do_pending_window_change (0);
- }
- }
- else
-#endif
- change_frame_size (f, XINT (width), XINT (height), 0, 0, 0,
- NILP (pixelwise) ? 0 : 1);
+ pixel_width = (!NILP (pixelwise)
+ ? XINT (width)
+ : XINT (width) * FRAME_COLUMN_WIDTH (f));
+ pixel_height = (!NILP (pixelwise)
+ ? XINT (height)
+ : XINT (height) * FRAME_LINE_HEIGHT (f));
+
+ if (pixel_width != FRAME_TEXT_WIDTH (f)
+ || pixel_height != FRAME_TEXT_HEIGHT (f))
+ adjust_frame_size (f, pixel_width, pixel_height, 1, 0);
return Qnil;
}
@@ -2751,9 +2986,11 @@ static const struct frame_parm_table frame_parms[] =
{"mouse-color", &Qmouse_color},
{"name", &Qname},
{"scroll-bar-width", &Qscroll_bar_width},
+ {"scroll-bar-height", &Qscroll_bar_height},
{"title", &Qtitle},
{"unsplittable", &Qunsplittable},
{"vertical-scroll-bars", &Qvertical_scroll_bars},
+ {"horizontal-scroll-bars", &Qhorizontal_scroll_bars},
{"visibility", &Qvisibility},
{"tool-bar-lines", &Qtool_bar_lines},
{"scroll-bar-foreground", &Qscroll_bar_foreground},
@@ -2786,7 +3023,7 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
/* If both of these parameters are present, it's more efficient to
set them both at once. So we wait until we've looked at the
entire list before we set them. */
- int width = 0, height = 0;
+ int width, height;
bool width_change = 0, height_change = 0;
/* Same here. */
@@ -2964,9 +3201,6 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
{
Lisp_Object frame;
- /* Make this 1, eventually. */
- check_frame_size (f, &width, &height, 1);
-
XSETFRAME (frame, f);
if ((width_change || height_change)
@@ -3117,6 +3351,14 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
for non-toolkit scroll bar.
ruler-mode.el depends on this. */
: Qnil));
+ store_in_alist (alistptr, Qscroll_bar_height,
+ (! FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)
+ ? make_number (0)
+ : FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) > 0
+ ? make_number (FRAME_CONFIG_SCROLL_BAR_HEIGHT (f))
+ /* nil means "use default height"
+ for non-toolkit scroll bar. */
+ : Qnil));
/* FRAME_X_WINDOW is not guaranteed to return an integer. E.g., on
MS-Windows it returns a value whose type is HANDLE, which is
actually a pointer. Explicit casting avoids compiler
@@ -3393,58 +3635,66 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
}
}
-
void
-x_set_fringe_width (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
+x_set_left_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
- compute_fringe_widths (f, 1);
-#ifdef HAVE_X_WINDOWS
- /* Must adjust this so window managers report correct number of columns. */
- if (FRAME_X_WINDOW (f) != 0)
- x_wm_set_size_hint (f, 0, 0);
-#endif
+ int unit = FRAME_COLUMN_WIDTH (f);
+ int old_width = FRAME_LEFT_FRINGE_WIDTH (f);
+ int new_width;
+
+ new_width = (RANGED_INTEGERP (-INT_MAX, new_value, INT_MAX)
+ ? eabs (XINT (new_value)) : 8);
+
+ if (new_width != old_width)
+ {
+ FRAME_LEFT_FRINGE_WIDTH (f) = new_width;
+ FRAME_FRINGE_COLS (f) /* Round up. */
+ = (new_width + FRAME_RIGHT_FRINGE_WIDTH (f) + unit - 1) / unit;
+
+ if (FRAME_X_WINDOW (f) != 0)
+ adjust_frame_size (f, -1, -1, 3, 0);
+
+ SET_FRAME_GARBAGED (f);
+ }
}
+
void
-x_set_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+x_set_right_fringe (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
{
- CHECK_TYPE_RANGED_INTEGER (int, arg);
+ int unit = FRAME_COLUMN_WIDTH (f);
+ int old_width = FRAME_RIGHT_FRINGE_WIDTH (f);
+ int new_width;
- if (XINT (arg) == f->border_width)
- return;
+ new_width = (RANGED_INTEGERP (-INT_MAX, new_value, INT_MAX)
+ ? eabs (XINT (new_value)) : 8);
- if (FRAME_X_WINDOW (f) != 0)
- error ("Cannot change the border width of a frame");
+ if (new_width != old_width)
+ {
+ FRAME_RIGHT_FRINGE_WIDTH (f) = new_width;
+ FRAME_FRINGE_COLS (f) /* Round up. */
+ = (new_width + FRAME_LEFT_FRINGE_WIDTH (f) + unit - 1) / unit;
- f->border_width = XINT (arg);
+ if (FRAME_X_WINDOW (f) != 0)
+ adjust_frame_size (f, -1, -1, 3, 0);
+
+ SET_FRAME_GARBAGED (f);
+ }
}
+
void
-x_set_internal_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+x_set_border_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
- int old = FRAME_INTERNAL_BORDER_WIDTH (f);
-
CHECK_TYPE_RANGED_INTEGER (int, arg);
- FRAME_INTERNAL_BORDER_WIDTH (f) = XINT (arg);
- if (FRAME_INTERNAL_BORDER_WIDTH (f) < 0)
- FRAME_INTERNAL_BORDER_WIDTH (f) = 0;
-#ifdef USE_X_TOOLKIT
- if (FRAME_X_OUTPUT (f)->edit_widget)
- widget_store_internal_border (FRAME_X_OUTPUT (f)->edit_widget);
-#endif
-
- if (FRAME_INTERNAL_BORDER_WIDTH (f) == old)
+ if (XINT (arg) == f->border_width)
return;
if (FRAME_X_WINDOW (f) != 0)
- {
- x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
- SET_FRAME_GARBAGED (f);
- do_pending_window_change (0);
- }
- else
- SET_FRAME_GARBAGED (f);
+ error ("Cannot change the border width of a frame");
+
+ f->border_width = XINT (arg);
}
void
@@ -3456,18 +3706,13 @@ x_set_right_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
FRAME_RIGHT_DIVIDER_WIDTH (f) = XINT (arg);
if (FRAME_RIGHT_DIVIDER_WIDTH (f) < 0)
FRAME_RIGHT_DIVIDER_WIDTH (f) = 0;
-
- if (FRAME_RIGHT_DIVIDER_WIDTH (f) == old)
- return;
-
- if (FRAME_X_WINDOW (f) != 0)
+ if (FRAME_RIGHT_DIVIDER_WIDTH (f) != old)
{
- x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
+ adjust_frame_size (f, -1, -1, 4, 0);
+ adjust_frame_glyphs (f);
SET_FRAME_GARBAGED (f);
- do_pending_window_change (0);
}
- else
- SET_FRAME_GARBAGED (f);
+
}
void
@@ -3479,18 +3724,12 @@ x_set_bottom_divider_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval
FRAME_BOTTOM_DIVIDER_WIDTH (f) = XINT (arg);
if (FRAME_BOTTOM_DIVIDER_WIDTH (f) < 0)
FRAME_BOTTOM_DIVIDER_WIDTH (f) = 0;
-
- if (FRAME_BOTTOM_DIVIDER_WIDTH (f) == old)
- return;
-
- if (FRAME_X_WINDOW (f) != 0)
+ if (FRAME_BOTTOM_DIVIDER_WIDTH (f) != old)
{
- x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 1);
+ adjust_frame_size (f, -1, -1, 4, 0);
+ adjust_frame_glyphs (f);
SET_FRAME_GARBAGED (f);
- do_pending_window_change (0);
}
- else
- SET_FRAME_GARBAGED (f);
}
void
@@ -3531,7 +3770,7 @@ x_set_vertical_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval
if ((EQ (arg, Qleft) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f))
|| (EQ (arg, Qright) && FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f))
|| (NILP (arg) && FRAME_HAS_VERTICAL_SCROLL_BARS (f))
- || (!NILP (arg) && ! FRAME_HAS_VERTICAL_SCROLL_BARS (f)))
+ || (!NILP (arg) && !FRAME_HAS_VERTICAL_SCROLL_BARS (f)))
{
FRAME_VERTICAL_SCROLL_BAR_TYPE (f)
= (NILP (arg)
@@ -3551,13 +3790,35 @@ x_set_vertical_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval
However, if the window hasn't been created yet, we shouldn't
call x_set_window_size. */
if (FRAME_X_WINDOW (f))
- x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
- FRAME_TEXT_HEIGHT (f), 1);
- do_pending_window_change (0);
+ adjust_frame_size (f, -1, -1, 3, 0);
+
+ SET_FRAME_GARBAGED (f);
}
}
void
+x_set_horizontal_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+ if ((NILP (arg) && FRAME_HAS_HORIZONTAL_SCROLL_BARS (f))
+ || (!NILP (arg) && !FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)))
+ {
+ FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)
+ = NILP (arg) ? false : true;
+
+ /* We set this parameter before creating the X window for the
+ frame, so we can get the geometry right from the start.
+ However, if the window hasn't been created yet, we shouldn't
+ call x_set_window_size. */
+ if (FRAME_X_WINDOW (f))
+ adjust_frame_size (f, -1, -1, 3, 0);
+
+ SET_FRAME_GARBAGED (f);
+ }
+#endif
+}
+
+void
x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
int unit = FRAME_COLUMN_WIDTH (f);
@@ -3567,9 +3828,9 @@ x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
x_set_scroll_bar_default_width (f);
if (FRAME_X_WINDOW (f))
- x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
- FRAME_TEXT_HEIGHT (f), 1);
- do_pending_window_change (0);
+ adjust_frame_size (f, -1, -1, 3, 0);
+
+ SET_FRAME_GARBAGED (f);
}
else if (RANGED_INTEGERP (1, arg, INT_MAX)
&& XFASTINT (arg) != FRAME_CONFIG_SCROLL_BAR_WIDTH (f))
@@ -3577,19 +3838,47 @@ x_set_scroll_bar_width (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = XFASTINT (arg);
FRAME_CONFIG_SCROLL_BAR_COLS (f) = (XFASTINT (arg) + unit - 1) / unit;
if (FRAME_X_WINDOW (f))
- x_set_window_size (f, 0, FRAME_TEXT_WIDTH (f),
- FRAME_TEXT_HEIGHT (f), 1);
- do_pending_window_change (0);
+ adjust_frame_size (f, -1, -1, 3, 0);
+
+ SET_FRAME_GARBAGED (f);
}
- /* Eventually remove the following call. It should have been done by
- x_set_window_size already. */
- change_frame_size (f, 0, 0, 0, 0, 0, 1);
XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.hpos = 0;
XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.x = 0;
}
void
+x_set_scroll_bar_height (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+{
+#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+ int unit = FRAME_LINE_HEIGHT (f);
+
+ if (NILP (arg))
+ {
+ x_set_scroll_bar_default_height (f);
+
+ if (FRAME_X_WINDOW (f))
+ adjust_frame_size (f, -1, -1, 3, 0);
+
+ SET_FRAME_GARBAGED (f);
+ }
+ else if (RANGED_INTEGERP (1, arg, INT_MAX)
+ && XFASTINT (arg) != FRAME_CONFIG_SCROLL_BAR_HEIGHT (f))
+ {
+ FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) = XFASTINT (arg);
+ FRAME_CONFIG_SCROLL_BAR_LINES (f) = (XFASTINT (arg) + unit - 1) / unit;
+ if (FRAME_X_WINDOW (f))
+ adjust_frame_size (f, -1, -1, 3, 0);
+
+ SET_FRAME_GARBAGED (f);
+ }
+
+ XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.vpos = 0;
+ XWINDOW (FRAME_SELECTED_WINDOW (f))->cursor.y = 0;
+#endif
+}
+
+void
x_set_alpha (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
double alpha = 1.0;
@@ -4190,7 +4479,7 @@ On Nextstep, this just calls `ns-parse-geometry'. */)
long
x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
{
- register Lisp_Object tem0, tem1, tem2;
+ Lisp_Object height, width, user_size, top, left, user_position;
long window_prompting = 0;
Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
@@ -4200,58 +4489,54 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
SET_FRAME_WIDTH (f, DEFAULT_COLS * FRAME_COLUMN_WIDTH (f));
SET_FRAME_COLS (f, DEFAULT_COLS);
SET_FRAME_HEIGHT (f, DEFAULT_ROWS * FRAME_LINE_HEIGHT (f));
- FRAME_LINES (f) = DEFAULT_ROWS;
+ SET_FRAME_LINES (f, DEFAULT_ROWS);
/* Window managers expect that if program-specified
positions are not (0,0), they're intentional, not defaults. */
f->top_pos = 0;
f->left_pos = 0;
- /* Ensure that old new_width and new_height will not override the
- values set here. */
- /* ++KFS: This was specific to W32, but seems ok for all platforms */
- f->new_width = f->new_height = f->new_pixelwise = 0;
+ /* Ensure that earlier new_width and new_height settings won't
+ override what we specify below. */
+ f->new_width = f->new_height = 0;
- tem0 = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
- tem1 = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
- tem2 = x_get_arg (dpyinfo, parms, Quser_size, 0, 0, RES_TYPE_NUMBER);
- if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
+ height = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
+ width = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
+ if (!EQ (width, Qunbound) || !EQ (height, Qunbound))
{
- if (!EQ (tem0, Qunbound))
+ if (!EQ (width, Qunbound))
{
- CHECK_NUMBER (tem0);
- if (! (0 <= XINT (tem0) && XINT (tem0) <= INT_MAX))
- xsignal1 (Qargs_out_of_range, tem0);
- FRAME_LINES (f) = XINT (tem0);
+ CHECK_NUMBER (width);
+ if (! (0 <= XINT (width) && XINT (width) <= INT_MAX))
+ xsignal1 (Qargs_out_of_range, width);
+
+ SET_FRAME_WIDTH (f, XINT (width) * FRAME_COLUMN_WIDTH (f));
}
- if (!EQ (tem1, Qunbound))
+
+ if (!EQ (height, Qunbound))
{
- CHECK_NUMBER (tem1);
- if (! (0 <= XINT (tem1) && XINT (tem1) <= INT_MAX))
- xsignal1 (Qargs_out_of_range, tem1);
- SET_FRAME_COLS (f, XINT (tem1));
+ CHECK_NUMBER (height);
+ if (! (0 <= XINT (height) && XINT (height) <= INT_MAX))
+ xsignal1 (Qargs_out_of_range, height);
+
+ SET_FRAME_HEIGHT (f, XINT (height) * FRAME_LINE_HEIGHT (f));
}
- if (!NILP (tem2) && !EQ (tem2, Qunbound))
+
+ user_size = x_get_arg (dpyinfo, parms, Quser_size, 0, 0, RES_TYPE_NUMBER);
+ if (!NILP (user_size) && !EQ (user_size, Qunbound))
window_prompting |= USSize;
else
window_prompting |= PSize;
}
-
- /* This used to be done _before_ calling x_figure_window_size, but
- since the height is reset here, this was really a no-op. I
- assume that moving it here does what Gerd intended (although he
- no longer can remember what that was... ++KFS, 2003-03-25. */
-
- /* Add the tool-bar height to the initial frame height so that the
- user gets a text display area of the size he specified with -g or
- via .Xdefaults. Later changes of the tool-bar height don't
- change the frame size. This is done so that users can create
- tall Emacs frames without having to guess how tall the tool-bar
- will get. */
- if (toolbar_p && FRAME_TOOL_BAR_HEIGHT (f))
+ /* Add a tool bar height to the initial frame height so that the user
+ gets a text display area of the size he specified with -g or via
+ .Xdefaults. Later changes of the tool bar height don't change the
+ frame size. This is done so that users can create tall Emacs
+ frames without having to guess how tall the tool bar will get. */
+ if (toolbar_p && FRAME_TOOL_BAR_LINES (f))
{
- int margin, relief, bar_height;
+ int margin, relief;
relief = (tool_bar_button_relief >= 0
? tool_bar_button_relief
@@ -4265,78 +4550,73 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
else
margin = 0;
- /* PXW: We should be able to not round here. */
- bar_height = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
- FRAME_LINES (f) += (bar_height + FRAME_LINE_HEIGHT (f) - 1) / FRAME_LINE_HEIGHT (f);
+ FRAME_TOOL_BAR_HEIGHT (f)
+ = DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * relief;
+ Vframe_initial_frame_tool_bar_height = make_number (FRAME_TOOL_BAR_HEIGHT (f));
}
- compute_fringe_widths (f, 0);
-
- SET_FRAME_WIDTH (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f));
- SET_FRAME_HEIGHT(f, FRAME_LINES (f) * FRAME_LINE_HEIGHT (f));
-
- tem0 = x_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER);
- tem1 = x_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER);
- tem2 = x_get_arg (dpyinfo, parms, Quser_position, 0, 0, RES_TYPE_NUMBER);
- if (! EQ (tem0, Qunbound) || ! EQ (tem1, Qunbound))
+ top = x_get_arg (dpyinfo, parms, Qtop, 0, 0, RES_TYPE_NUMBER);
+ left = x_get_arg (dpyinfo, parms, Qleft, 0, 0, RES_TYPE_NUMBER);
+ user_position = x_get_arg (dpyinfo, parms, Quser_position, 0, 0, RES_TYPE_NUMBER);
+ if (! EQ (top, Qunbound) || ! EQ (left, Qunbound))
{
- if (EQ (tem0, Qminus))
+ if (EQ (top, Qminus))
{
f->top_pos = 0;
window_prompting |= YNegative;
}
- else if (CONSP (tem0) && EQ (XCAR (tem0), Qminus)
- && CONSP (XCDR (tem0))
- && RANGED_INTEGERP (-INT_MAX, XCAR (XCDR (tem0)), INT_MAX))
+ else if (CONSP (top) && EQ (XCAR (top), Qminus)
+ && CONSP (XCDR (top))
+ && RANGED_INTEGERP (-INT_MAX, XCAR (XCDR (top)), INT_MAX))
{
- f->top_pos = - XINT (XCAR (XCDR (tem0)));
+ f->top_pos = - XINT (XCAR (XCDR (top)));
window_prompting |= YNegative;
}
- else if (CONSP (tem0) && EQ (XCAR (tem0), Qplus)
- && CONSP (XCDR (tem0))
- && TYPE_RANGED_INTEGERP (int, XCAR (XCDR (tem0))))
+ else if (CONSP (top) && EQ (XCAR (top), Qplus)
+ && CONSP (XCDR (top))
+ && TYPE_RANGED_INTEGERP (int, XCAR (XCDR (top))))
{
- f->top_pos = XINT (XCAR (XCDR (tem0)));
+ f->top_pos = XINT (XCAR (XCDR (top)));
}
- else if (EQ (tem0, Qunbound))
+ else if (EQ (top, Qunbound))
f->top_pos = 0;
else
{
- CHECK_TYPE_RANGED_INTEGER (int, tem0);
- f->top_pos = XINT (tem0);
+ CHECK_TYPE_RANGED_INTEGER (int, top);
+ f->top_pos = XINT (top);
if (f->top_pos < 0)
window_prompting |= YNegative;
}
- if (EQ (tem1, Qminus))
+ if (EQ (left, Qminus))
{
f->left_pos = 0;
window_prompting |= XNegative;
}
- else if (CONSP (tem1) && EQ (XCAR (tem1), Qminus)
- && CONSP (XCDR (tem1))
- && RANGED_INTEGERP (-INT_MAX, XCAR (XCDR (tem1)), INT_MAX))
+ else if (CONSP (left) && EQ (XCAR (left), Qminus)
+ && CONSP (XCDR (left))
+ && RANGED_INTEGERP (-INT_MAX, XCAR (XCDR (left)), INT_MAX))
{
- f->left_pos = - XINT (XCAR (XCDR (tem1)));
+ f->left_pos = - XINT (XCAR (XCDR (left)));
window_prompting |= XNegative;
}
- else if (CONSP (tem1) && EQ (XCAR (tem1), Qplus)
- && CONSP (XCDR (tem1))
- && TYPE_RANGED_INTEGERP (int, XCAR (XCDR (tem1))))
+ else if (CONSP (left) && EQ (XCAR (left), Qplus)
+ && CONSP (XCDR (left))
+ && TYPE_RANGED_INTEGERP (int, XCAR (XCDR (left))))
{
- f->left_pos = XINT (XCAR (XCDR (tem1)));
+ f->left_pos = XINT (XCAR (XCDR (left)));
}
- else if (EQ (tem1, Qunbound))
+ else if (EQ (left, Qunbound))
f->left_pos = 0;
else
{
- CHECK_TYPE_RANGED_INTEGER (int, tem1);
- f->left_pos = XINT (tem1);
+ CHECK_TYPE_RANGED_INTEGER (int, left);
+ f->left_pos = XINT (left);
if (f->left_pos < 0)
window_prompting |= XNegative;
}
- if (!NILP (tem2) && ! EQ (tem2, Qunbound))
+ if (!NILP (user_position) && ! EQ (user_position, Qunbound))
window_prompting |= USPosition;
else
window_prompting |= PPosition;
@@ -4483,6 +4763,7 @@ syms_of_frame (void)
{
DEFSYM (Qframep, "framep");
DEFSYM (Qframe_live_p, "frame-live-p");
+ DEFSYM (Qframe_windows_min_size, "frame-windows-min-size");
DEFSYM (Qexplicit_name, "explicit-name");
DEFSYM (Qheight, "height");
DEFSYM (Qicon, "icon");
@@ -4601,7 +4882,7 @@ Setting this variable does not affect existing frames, only new ones. */);
Vdefault_frame_alist = Qnil;
DEFVAR_LISP ("default-frame-scroll-bars", Vdefault_frame_scroll_bars,
- doc: /* Default position of scroll bars on this window-system. */);
+ doc: /* Default position of vertical scroll bars on this window-system. */);
#ifdef HAVE_WINDOW_SYSTEM
#if defined (HAVE_NTGUI) || defined (NS_IMPL_COCOA) || (defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS))
/* MS-Windows, Mac OS X, and GTK have scroll bars on the right by
@@ -4614,6 +4895,14 @@ Setting this variable does not affect existing frames, only new ones. */);
Vdefault_frame_scroll_bars = Qnil;
#endif
+ DEFVAR_LISP ("default-frame-horizontal-scroll-bars", Vdefault_frame_horizontal_scroll_bars,
+ doc: /* Default value for horizontal scroll bars on this window-system. */);
+#ifdef HAVE_WINDOW_SYSTEM
+ Vdefault_frame_horizontal_scroll_bars = Qt;
+#else
+ Vdefault_frame_horizontal_scroll_bars = Qnil;
+#endif
+
DEFVAR_BOOL ("scroll-bar-adjust-thumb-portion",
scroll_bar_adjust_thumb_portion_p,
doc: /* Adjust thumb for overscrolling for Gtk+ and MOTIF.
@@ -4690,6 +4979,10 @@ or call the function `tool-bar-mode'. */);
Vtool_bar_mode = Qnil;
#endif
+ DEFVAR_LISP ("frame-initial-frame-tool-bar-height", Vframe_initial_frame_tool_bar_height,
+ doc: /* Height of tool bar of initial frame. */);
+ Vframe_initial_frame_tool_bar_height = make_number (0);
+
DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
doc: /* Minibufferless frames use this frame's minibuffer.
Emacs cannot create minibufferless frames unless this is set to an
@@ -4718,11 +5011,19 @@ current values of `frame-char-height' and `frame-char-width'. If this
is non-nil, no rounding occurs, hence frame sizes can increase/decrease
by one pixel.
-With some window managers you have to set this to non-nil in order to
-fully maximize frames. To resize your initial frame pixelwise,
-set this option to a non-nil value in your init file. */);
+With some window managers you may have to set this to non-nil in order
+to fully maximize frames. To resize your initial frame pixelwise, set
+this option to a non-nil value in your init file. */);
frame_resize_pixelwise = 0;
+ DEFVAR_BOOL ("frame-inhibit-implied-resize", frame_inhibit_implied_resize,
+ doc: /* Non-nil means do not resize frame implicitly.
+If this option is nil, setting default font, menubar mode, fringe width,
+or scroll bar mode of a specific frame may resize the frame in order to
+preserve the number of columns or lines it displays. If this option is
+non-nil, no such resizing is done. */);
+ frame_inhibit_implied_resize = 0;
+
staticpro (&Vframe_list);
defsubr (&Sframep);
@@ -4765,9 +5066,11 @@ set this option to a non-nil value in your init file. */);
defsubr (&Sframe_text_cols);
defsubr (&Sframe_text_lines);
defsubr (&Sframe_total_cols);
+ defsubr (&Sframe_total_lines);
defsubr (&Sframe_text_width);
defsubr (&Sframe_text_height);
defsubr (&Sscroll_bar_width);
+ defsubr (&Sscroll_bar_height);
defsubr (&Sfringe_width);
defsubr (&Sborder_width);
defsubr (&Sright_divider_width);