Subject: Re: bug#46827: Broken initial size of GTK3 frame

From: Robert Pluim <[email-masked]>
Date: Mon, 01 Mar 2021 14:30:58 +0100

>>>>> On Mon, 1 Mar 2021 13:38:58 +0100, martin rudalics <[email-masked]> said:

    >> Iʼll just say I donʼt see this with Gnome on Debian testing, with
    >> either emacs-27 or master, so once again itʼs window manager
    >> dependent.

    martin> What does (frame-height) give for your frame?

30. A lucid build gives me 31, so itʼs no better. (all emacs-27)

Iʼll install xfwm4 and see what happens.

    >> Iʼm surprised that querying another font backend when we've already
    >> found a font causes frame sizing issues like this. Do we understand
    >> the cause here?

    martin> No.  All I can say is that it is tool bar related.

<wild stab in the dark> What happens if you disable the code that
displays text labels in the tool bar:

diff --git a/src/gtkutil.c b/src/gtkutil.c
index 825fbe1d45..425b0727e9 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -4708,8 +4708,6 @@ xg_make_tool_item (struct frame *f,
 
   if (wimage && !text_image)
     gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0);
-  if (label)
-    gtk_box_pack_start (GTK_BOX (vb), gtk_label_new (label), TRUE, TRUE, 0);
   if (wimage && text_image)
     gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0);
 
@@ -4723,7 +4721,7 @@ xg_make_tool_item (struct frame *f,
   gtk_container_add (GTK_CONTAINER (weventbox), wb);
   gtk_container_add (GTK_CONTAINER (ti), weventbox);
 
-  if (wimage || label)
+  if (wimage)
     {
       intptr_t ii = i;
       gpointer gi = (gpointer) ii;

    >> We can revert the bug#43177 fix of course, but perhaps we should make
    >> it conditional on !GTK3 || PGTK or something?

    martin> First I'd like to fix the behavior for Emacs 27, conceptually at least.
    martin> Then we can discuss Bug#43177.

Works for me.

Robert
--