Subject: bug#19076: 25.0.50; Switching vertical scroll bars off makes the mode line and buffer area disappear

From: martin rudalics <[email-masked]>
Date: Thu, 20 Nov 2014 17:03:46 +0100

> ((frame-position 0 . 0) (frame-outer-size 598 . 1184) (external-border-size 1 . 1) (title-height . 0) (menu-bar-external) (menu-bar-size 0 . 0) (tool-bar-external) (tool-bar-position . top) (tool-bar-size 596 . 36) (frame-inner-size 596 . 1146))

These values are as expected too.

 > If I resize the frame, the mode line and echo area reappears.  If I just
 > split a window, the uppermost window gets a mode line, but there's still
 > no mode line or echo area in the bottom window.

I see.  Does the problem also appear when you turn the tool bar
initially off?  Do you use `desktop-save-mode'?  If any of these is
true, can you try the patch I proposed for Bug#19048 and which I attach
here again.

Thanks, martin
diff --git a/src/w32fns.c b/src/w32fns.c
index 1b290b7..e514970 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1721,15 +1721,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
   else
     nlines = 0;

-  if (nlines == 0)
-    x_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
-  else
-    {
-      f->n_tool_bar_rows = 0;
-      FRAME_TOOL_BAR_LINES (f) = nlines;
-      adjust_frame_glyphs (f);
-      SET_FRAME_GARBAGED (f);
-    }
+  x_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
 }

@@ -1749,11 +1741,7 @@ x_change_tool_bar_height (struct frame *f, int height)
   /* Recalculate tool bar and frame text sizes.  */
   FRAME_TOOL_BAR_HEIGHT (f) = height;
   FRAME_TOOL_BAR_LINES (f) = lines;
-/**   FRAME_TEXT_HEIGHT (f) **/
-/**     = FRAME_PIXEL_TO_TEXT_HEIGHT (f, FRAME_PIXEL_HEIGHT (f)); **/
-/**   FRAME_LINES (f) **/
-/**     = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, FRAME_PIXEL_HEIGHT (f)); **/
-  /* Store the `tool-bar-lines' and `height' frame parameters.  */
+  /* Store `tool-bar-lines' and `height' frame parameters.  */
   store_frame_param (f, Qtool_bar_lines, make_number (lines));
   store_frame_param (f, Qheight, make_number (FRAME_LINES (f)));

@@ -1772,6 +1760,10 @@ x_change_tool_bar_height (struct frame *f, int height)
   adjust_frame_size (f, -1, -1, (old_height == 0 || height == 0) ? 2 : 4, 0,
 		     Qtool_bar_lines);

+  /* adjust_frame_size might not have done anything, garbage frame
+     here.  */
+  adjust_frame_glyphs (f);
+  SET_FRAME_GARBAGED (f);
   if (FRAME_X_WINDOW (f))
     x_clear_under_internal_border (f);
 }
diff --git a/src/xfns.c b/src/xfns.c
index aaa75f2..59715d0 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1075,19 +1075,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
   else
     nlines = 0;

-#ifdef USE_GTK
   x_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
-#else /* !USE_GTK */
-  if (nlines == 0)
-    x_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
-  else
-    {
-      f->n_tool_bar_rows = 0;
-      FRAME_TOOL_BAR_LINES (f) = nlines;
-      adjust_frame_glyphs (f);
-      SET_FRAME_GARBAGED (f);
-    }
-#endif /* USE_GTK */
 }

@@ -1124,10 +1112,6 @@ x_change_tool_bar_height (struct frame *f, int height)
   /* Recalculate tool bar and frame text sizes.  */
   FRAME_TOOL_BAR_HEIGHT (f) = height;
   FRAME_TOOL_BAR_LINES (f) = lines;
-/**   FRAME_TEXT_HEIGHT (f) **/
-/**     = FRAME_PIXEL_TO_TEXT_HEIGHT (f, FRAME_PIXEL_HEIGHT (f)); **/
-/**   FRAME_LINES (f) **/
-/**     = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, FRAME_PIXEL_HEIGHT (f)); **/
   /* Store the `tool-bar-lines' and `height' frame parameters.  */
   store_frame_param (f, Qtool_bar_lines, make_number (lines));
   store_frame_param (f, Qheight, make_number (FRAME_LINES (f)));
@@ -1153,6 +1137,10 @@ x_change_tool_bar_height (struct frame *f, int height)
   adjust_frame_size (f, -1, -1, (old_height == 0 || height == 0) ? 2 : 4, 0,
 		     Qtool_bar_lines);

+  /* adjust_frame_size might not have done anything, garbage frame
+     here.  */
+  adjust_frame_glyphs (f);
+  SET_FRAME_GARBAGED (f);
   if (FRAME_X_WINDOW (f))
     x_clear_under_internal_border (f);