Subject: Re: bug#52493: 29.0.50; Setting Inconsolata up in init.el makes default face rendered wrong

From: martin rudalics <[email-masked]>
Date: Sun, 25 Dec 2022 17:07:47 +0100

> Done, here:

Still tapping in the dark.  One other possibility I see is that we
somehow mess things up with the menu or tool bar.  Next patch, three
iterations suffice, please post contents of *foo*.

Thanks, martin

diff --git a/lisp/window.el b/lisp/window.el
index a11293d372..3d064e12d7 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -10596,6 +10596,17 @@ window-prefix-map
   "0" #'delete-windows-on)
 (define-key ctl-x-map "w" window-prefix-map)
 
+(defun foo-it (&rest rest)
+  (with-current-buffer (get-buffer-create "*foo*")
+    (goto-char (point-max))
+    (when rest
+      (insert (format "%s" (car rest)))
+      (setq rest (cdr rest))
+      (while rest
+	(insert (format " .. %s" (car rest)))
+	(setq rest (cdr rest)))
+      (insert "\n"))))
+
 (provide 'window)
 
 ;;; window.el ends here
diff --git a/src/frame.c b/src/frame.c
index b57b296be5..e4f3c1c559 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -906,6 +906,12 @@ adjust_frame_size (struct frame *f, int new_text_width, int new_text_height,
 
   unblock_input ();
 
+  call7 (Qfoo_it, intern ("adjust_frame_size"),
+	 intern ("old pixels/lines"), make_fixnum (old_native_height),
+	 make_fixnum (old_text_lines),
+	 intern ("new pixels/lines"), make_fixnum (new_native_height),
+	 make_fixnum (new_text_lines));
+
 #ifdef HAVE_WINDOW_SYSTEM
   {
     /* Adjust size of F's child frames.  */
diff --git a/src/gtkutil.c b/src/gtkutil.c
index a6bba096a4..1219a148cc 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1972,8 +1972,7 @@ xg_wm_set_size_hint (struct frame *f, long int flags, bool user_position)
      Gtk+ and/or Unity on Ubuntu 12.04 can't handle it.
      Obviously this makes the row/col value displayed off by 1.  */
   base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 1) + FRAME_TOOLBAR_WIDTH (f);
-  base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 1)
-    + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
+  base_height = FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
 
   size_hints.base_width = base_width;
   size_hints.base_height = base_height;
@@ -2028,6 +2027,13 @@ xg_wm_set_size_hint (struct frame *f, long int flags, bool user_position)
 		 &f->output_data.xp->size_hints,
 		 sizeof (size_hints)) != 0)
     {
+      call8 (Qfoo_it, intern ("xg_wm_set_size_hint"),
+	     intern ("line_height & scale"),
+	     make_fixnum (FRAME_LINE_HEIGHT (f)), make_fixnum (scale),
+	     intern ("base_height"), make_fixnum (size_hints.base_height),
+	     intern ("height_inc"), make_fixnum (size_hints.height_inc));
+      call4 (Qfoo_it, intern ("  menubar_height"), make_fixnum (FRAME_MENUBAR_HEIGHT (f)),
+	     intern ("toolbar_height"), make_fixnum (FRAME_TOOLBAR_HEIGHT (f)));
       block_input ();
       gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
                                      NULL, &size_hints, hint_flags);
diff --git a/src/window.c b/src/window.c
index f116b9a9d7..c090f29461 100644
--- a/src/window.c
+++ b/src/window.c
@@ -8394,6 +8394,7 @@ syms_of_window (void)
   DEFSYM (Qheader_line_format, "header-line-format");
   DEFSYM (Qtab_line_format, "tab-line-format");
   DEFSYM (Qno_other_window, "no-other-window");
+  DEFSYM (Qfoo_it, "foo-it");
 
   DEFVAR_LISP ("temp-buffer-show-function", Vtemp_buffer_show_function,
 	       doc: /* Non-nil means call as function to display a help buffer.
diff --git a/src/xterm.c b/src/xterm.c
index 7eaf59d54b..a701bae9af 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -26175,6 +26175,11 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
   get_font_ascent_descent (font, &font_ascent, &font_descent);
   FRAME_LINE_HEIGHT (f) = font_ascent + font_descent;
 
+  call7 (Qfoo_it, intern ("x_new_font"),
+	 intern ("ascent"), make_fixnum (font_ascent),
+	 intern ("descent"), make_fixnum (font_descent),
+	 intern ("line_height"), make_fixnum (FRAME_LINE_HEIGHT (f)));
+
 #ifndef USE_X_TOOLKIT
   FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
 #endif