unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Angelo Graziosi <angelo.graziosi@alice.it>, 19048@debbugs.gnu.org
Subject: bug#19048: Frame height decreases at Emacs start
Date: Wed, 19 Nov 2014 09:30:33 +0100	[thread overview]
Message-ID: <546C5529.4070904@gmx.at> (raw)
In-Reply-To: <546B82F4.7050609@gmx.at>

[-- Attachment #1: Type: text/plain, Size: 129 bytes --]

 >> BTW, I see the same issue in today build of Windows build (MSYS2-MinGW64)...

Please try the attached patch.

Thanks, martin

[-- Attachment #2: x_set_tool_bar_lines.patch --]
[-- Type: text/plain, Size: 3228 bytes --]

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);



  reply	other threads:[~2014-11-19  8:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <emacs-mail-is-unusable-4>
2014-11-15 14:10 ` bug#19060: [FIX INCLUDED] Off-by-one-line scrolling bug in window_scroll_pixel_based Angelo Graziosi
2014-11-15 14:33   ` martin rudalics
2014-11-15 17:18     ` Angelo Graziosi
2014-11-16 11:37       ` martin rudalics
2014-11-16 13:02         ` bug#19048: Frame height decreases at Emacs start Angelo Graziosi
2014-11-16 13:54           ` martin rudalics
2014-11-16 14:16             ` Angelo Graziosi
2014-11-16 14:22               ` martin rudalics
2014-11-16 14:33                 ` Angelo Graziosi
2014-11-16 14:42                   ` Angelo Graziosi
2014-11-16 15:14                   ` martin rudalics
2014-11-16 18:05                     ` Angelo Graziosi
2014-11-17 10:56                     ` Angelo Graziosi
2014-11-17 12:51                       ` Angelo Graziosi
2014-11-17 18:25                         ` martin rudalics
2014-11-17 19:50                           ` Angelo Graziosi
2014-11-18  7:51                             ` martin rudalics
2014-11-18 13:46                               ` Angelo Graziosi
2014-11-18 14:38                               ` Angelo Graziosi
2014-11-18 17:33                                 ` martin rudalics
2014-11-19  8:30                                   ` martin rudalics [this message]
2014-11-19 11:34                                     ` Angelo Graziosi
2014-11-19 15:52                                       ` martin rudalics
2014-11-13 21:01 Angelo Graziosi
2014-12-31 18:35 ` martin rudalics
2014-12-31 22:06   ` Angelo Graziosi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=546C5529.4070904@gmx.at \
    --to=rudalics@gmx.at \
    --cc=19048@debbugs.gnu.org \
    --cc=angelo.graziosi@alice.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).