aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.h
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/window.h
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/window.h')
-rw-r--r--src/window.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/window.h b/src/window.h
index 6b0f0e5d07c..dfbc6385312 100644
--- a/src/window.h
+++ b/src/window.h
@@ -422,6 +422,14 @@ struct window
422 Otherwise draw them between margin areas and text. */ 422 Otherwise draw them between margin areas and text. */
423 bool_bf fringes_outside_margins : 1; 423 bool_bf fringes_outside_margins : 1;
424 424
425 /* True if this window's fringe specifications are persistent,
426 i.e., always survive Fset_window_buffer. */
427 bool_bf fringes_persistent : 1;
428
429 /* True if this window's croll bar specifications are persistent,
430 i.e., always survive Fset_window_buffer. */
431 bool_bf scroll_bars_persistent : 1;
432
425 /* True if window_end_pos and window_end_vpos are truly valid. 433 /* True if window_end_pos and window_end_vpos are truly valid.
426 This is false if nontrivial redisplay is preempted since in that case 434 This is false if nontrivial redisplay is preempted since in that case
427 the frame image that window_end_pos did not get onto the frame. */ 435 the frame image that window_end_pos did not get onto the frame. */
@@ -860,7 +868,9 @@ wset_next_buffers (struct window *w, Lisp_Object val)
860 W. Horizontal scrollbars exist for toolkit versions only. */ 868 W. Horizontal scrollbars exist for toolkit versions only. */
861#if USE_HORIZONTAL_SCROLL_BARS 869#if USE_HORIZONTAL_SCROLL_BARS
862#define WINDOW_HAS_HORIZONTAL_SCROLL_BAR(W) \ 870#define WINDOW_HAS_HORIZONTAL_SCROLL_BAR(W) \
863 ((WINDOW_PSEUDO_P (W) || MINI_NON_ONLY_WINDOW_P (W)) \ 871 ((WINDOW_PSEUDO_P (W) \
872 || (MINI_WINDOW_P (W) \
873 && !EQ (W->horizontal_scroll_bar_type, Qbottom))) \
864 ? false \ 874 ? false \
865 : EQ (W->horizontal_scroll_bar_type, Qt) \ 875 : EQ (W->horizontal_scroll_bar_type, Qt) \
866 ? FRAME_HAS_HORIZONTAL_SCROLL_BARS (WINDOW_XFRAME (W)) \ 876 ? FRAME_HAS_HORIZONTAL_SCROLL_BARS (WINDOW_XFRAME (W)) \
@@ -1059,7 +1069,7 @@ extern Lisp_Object minibuf_selected_window;
1059extern Lisp_Object make_window (void); 1069extern Lisp_Object make_window (void);
1060extern Lisp_Object window_from_coordinates (struct frame *, int, int, 1070extern Lisp_Object window_from_coordinates (struct frame *, int, int,
1061 enum window_part *, bool); 1071 enum window_part *, bool);
1062extern void resize_frame_windows (struct frame *, int, bool, bool); 1072extern void resize_frame_windows (struct frame *, int, bool);
1063extern void restore_window_configuration (Lisp_Object); 1073extern void restore_window_configuration (Lisp_Object);
1064extern void delete_all_child_windows (Lisp_Object); 1074extern void delete_all_child_windows (Lisp_Object);
1065extern void grow_mini_window (struct window *, int); 1075extern void grow_mini_window (struct window *, int);