aboutsummaryrefslogtreecommitdiffstats
path: root/src/frame.c
diff options
context:
space:
mode:
authorMartin Rudalics2019-07-22 09:19:18 +0200
committerMartin Rudalics2019-07-22 09:19:18 +0200
commit8e0ebb9a3cb9beef2f5ff50436fef1c54a3e3c92 (patch)
treeacabc59171db5611552b1a45aeea2149beefe689 /src/frame.c
parent5ccaee4bbc184c53b262021361bd216af17e80f5 (diff)
downloademacs-8e0ebb9a3cb9beef2f5ff50436fef1c54a3e3c92.tar.gz
emacs-8e0ebb9a3cb9beef2f5ff50436fef1c54a3e3c92.zip
Handle persistence of windows' scroll bar and fringes settings (Bug#36193)
* doc/lispref/display.texi (Fringe Size/Pos): Document new argument PERSISTENT of 'set-window-fringes'. (Scroll Bars): Document new argument PERSISTENT of 'set-window-scroll-bars'. Mention that HORIZONTAL-TYPE must be 'bottom' to show a horizontal scroll bar on mini windows. * lisp/window.el (window-min-pixel-height): For mini windows the minimum height is one line. (window--min-size-1): Use value returned by 'window-min-pixel-height' when dealing with mini windows. (window--resize-mini-window): Try to handle horizontal scroll bars and size restrictions more accurately. (window--state-put-2): Handle persistence of scroll bar settings. * src/frame.c (make_frame): Allow horizontal scroll bars in mini windows. (adjust_frame_size): Drop PIXELWISE argument in 'resize_frame_windows' calls. * src/window.c (set_window_buffer): Don't override WINDOW's scroll bar and fringe settings when marked as persistent. (resize_frame_windows): Drop fourth argument PIXELWISE - SIZE is always specified in terms of pixels. Try to handle height of mini windows more accurately. (grow_mini_window, shrink_mini_window): Use body height of mini window when calculating expected height change. Take horizontal scroll bars into account. (struct saved_window): Two new members to handle persistence of window fringes and scroll bars. (Fset_window_configuration, save_window_save): Handle persistence of fringes and scroll bars. (set_window_fringes, set_window_scroll_bars): New arguments PERSISTENT. Make dimension checks more accurate. (Fset_window_fringes): New argument PERSISTENT. (Fwindow_fringes, Fwindow_scroll_bars): Add PERSISTENT to return values. (Fset_window_scroll_bars): New argument PERSISTENT. In doc-string mention that 'bottom' must be specified to get a horizontal scroll bar in mini windows. (compare_window_configurations): Add checks for persistence of fringes and scroll bars. * src/window.h (struct window): New boolean slots 'fringes_persistent' and 'scroll_bars_persistent'. (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Allow horizontal scroll bars for mini windows. (resize_frame_windows): Remove fourth argument of 'resize_frame_windows' in external declaration. * src/xdisp.c (resize_mini_window): Use box text height to tell whether mini window height changed. (set_horizontal_scroll_bar): Set mini window's horizontal scroll bar when its type is specified as 'bottom'. * etc/NEWS: Mention new options for 'set-window-fringes' and 'set-window-scroll-bars'.
Diffstat (limited to 'src/frame.c')
-rw-r--r--src/frame.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/frame.c b/src/frame.c
index 6363a873684..d94de417e4d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -712,7 +712,7 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit,
712 712
713 if (new_windows_width != old_windows_width) 713 if (new_windows_width != old_windows_width)
714 { 714 {
715 resize_frame_windows (f, new_windows_width, 1, 1); 715 resize_frame_windows (f, new_windows_width, true);
716 716
717 /* MSDOS frames cannot PRETEND, as they change frame size by 717 /* MSDOS frames cannot PRETEND, as they change frame size by
718 manipulating video hardware. */ 718 manipulating video hardware. */
@@ -737,7 +737,7 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit,
737 left edges. */ 737 left edges. */
738 || WINDOW_TOP_PIXEL_EDGE (r) != FRAME_TOP_MARGIN_HEIGHT (f)) 738 || WINDOW_TOP_PIXEL_EDGE (r) != FRAME_TOP_MARGIN_HEIGHT (f))
739 { 739 {
740 resize_frame_windows (f, new_windows_height, 0, 1); 740 resize_frame_windows (f, new_windows_height, false);
741 741
742 /* MSDOS frames cannot PRETEND, as they change frame size by 742 /* MSDOS frames cannot PRETEND, as they change frame size by
743 manipulating video hardware. */ 743 manipulating video hardware. */
@@ -931,15 +931,11 @@ make_frame (bool mini_p)
931 } 931 }
932 932
933 if (mini_p) 933 if (mini_p)
934 { 934 set_window_buffer (mini_window,
935 set_window_buffer (mini_window, 935 (NILP (Vminibuffer_list)
936 (NILP (Vminibuffer_list) 936 ? get_minibuffer (0)
937 ? get_minibuffer (0) 937 : Fcar (Vminibuffer_list)),
938 : Fcar (Vminibuffer_list)), 938 0, 0);
939 0, 0);
940 /* No horizontal scroll bars in minibuffers. */
941 wset_horizontal_scroll_bar (mw, Qnil);
942 }
943 939
944 fset_root_window (f, root_window); 940 fset_root_window (f, root_window);
945 fset_selected_window (f, root_window); 941 fset_selected_window (f, root_window);