aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-09-27 11:42:27 +0000
committerGerd Moellmann2000-09-27 11:42:27 +0000
commit52de7ce95d4b9bde0f0ee7e235ed97b6d9b470f3 (patch)
tree0f42ab03dadf5432d9512baabe4859db285bf775
parent60536eeaf73ebcc95fe3720cd346513fcac0aacf (diff)
downloademacs-52de7ce95d4b9bde0f0ee7e235ed97b6d9b470f3.tar.gz
emacs-52de7ce95d4b9bde0f0ee7e235ed97b6d9b470f3.zip
(x_set_tool_bar_lines): Don't use more lines for the
tool-bar than is available. (x_change_window_heights): Renamed from x_set_menu_bar_lines_1.
-rw-r--r--src/xfns.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 4355bdb5010..a2bc485dcb3 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -744,6 +744,7 @@ struct x_frame_parm_table
744 void (*setter) P_ ((struct frame *, Lisp_Object, Lisp_Object)); 744 void (*setter) P_ ((struct frame *, Lisp_Object, Lisp_Object));
745}; 745};
746 746
747static void x_change_window_heights P_ ((Lisp_Object, int));
747static void x_disable_image P_ ((struct frame *, struct image *)); 748static void x_disable_image P_ ((struct frame *, struct image *));
748static void x_create_im P_ ((struct frame *)); 749static void x_create_im P_ ((struct frame *));
749void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object)); 750void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
@@ -1916,9 +1917,12 @@ x_set_visibility (f, value, oldval)
1916 else 1917 else
1917 Fmake_frame_visible (frame); 1918 Fmake_frame_visible (frame);
1918} 1919}
1920
1919 1921
1922/* Change window heights in windows rooted in WINDOW by N lines. */
1923
1920static void 1924static void
1921x_set_menu_bar_lines_1 (window, n) 1925x_change_window_heights (window, n)
1922 Lisp_Object window; 1926 Lisp_Object window;
1923 int n; 1927 int n;
1924{ 1928{
@@ -1934,13 +1938,13 @@ x_set_menu_bar_lines_1 (window, n)
1934 1938
1935 /* Handle just the top child in a vertical split. */ 1939 /* Handle just the top child in a vertical split. */
1936 if (!NILP (w->vchild)) 1940 if (!NILP (w->vchild))
1937 x_set_menu_bar_lines_1 (w->vchild, n); 1941 x_change_window_heights (w->vchild, n);
1938 1942
1939 /* Adjust all children in a horizontal split. */ 1943 /* Adjust all children in a horizontal split. */
1940 for (window = w->hchild; !NILP (window); window = w->next) 1944 for (window = w->hchild; !NILP (window); window = w->next)
1941 { 1945 {
1942 w = XWINDOW (window); 1946 w = XWINDOW (window);
1943 x_set_menu_bar_lines_1 (window, n); 1947 x_change_window_heights (window, n);
1944 } 1948 }
1945} 1949}
1946 1950
@@ -1988,7 +1992,7 @@ x_set_menu_bar_lines (f, value, oldval)
1988 } 1992 }
1989#else /* not USE_X_TOOLKIT */ 1993#else /* not USE_X_TOOLKIT */
1990 FRAME_MENU_BAR_LINES (f) = nlines; 1994 FRAME_MENU_BAR_LINES (f) = nlines;
1991 x_set_menu_bar_lines_1 (f->root_window, nlines - olines); 1995 x_change_window_heights (f->root_window, nlines - olines);
1992#endif /* not USE_X_TOOLKIT */ 1996#endif /* not USE_X_TOOLKIT */
1993 adjust_glyphs (f); 1997 adjust_glyphs (f);
1994} 1998}
@@ -2005,7 +2009,8 @@ x_set_tool_bar_lines (f, value, oldval)
2005 struct frame *f; 2009 struct frame *f;
2006 Lisp_Object value, oldval; 2010 Lisp_Object value, oldval;
2007{ 2011{
2008 int delta, nlines; 2012 int delta, nlines, root_height;
2013 Lisp_Object root_window;
2009 2014
2010 /* Use VALUE only if an integer >= 0. */ 2015 /* Use VALUE only if an integer >= 0. */
2011 if (INTEGERP (value) && XINT (value) >= 0) 2016 if (INTEGERP (value) && XINT (value) >= 0)
@@ -2017,8 +2022,18 @@ x_set_tool_bar_lines (f, value, oldval)
2017 ++windows_or_buffers_changed; 2022 ++windows_or_buffers_changed;
2018 2023
2019 delta = nlines - FRAME_TOOL_BAR_LINES (f); 2024 delta = nlines - FRAME_TOOL_BAR_LINES (f);
2025
2026 /* Don't resize the tool-bar to more than we have room for. */
2027 root_window = FRAME_ROOT_WINDOW (f);
2028 root_height = XINT (XWINDOW (root_window)->height);
2029 if (root_height - delta < 1)
2030 {
2031 delta = root_height - 1;
2032 nlines = FRAME_TOOL_BAR_LINES (f) + delta;
2033 }
2034
2020 FRAME_TOOL_BAR_LINES (f) = nlines; 2035 FRAME_TOOL_BAR_LINES (f) = nlines;
2021 x_set_menu_bar_lines_1 (FRAME_ROOT_WINDOW (f), delta); 2036 x_change_window_heights (root_window, delta);
2022 adjust_glyphs (f); 2037 adjust_glyphs (f);
2023} 2038}
2024 2039