]> git.eshelyaron.com Git - emacs.git/commitdiff
On GTK do not inhibit implied resizing until tool bar was drawn (Bug#74750)
authorMartin Rudalics <rudalics@gmx.at>
Fri, 20 Dec 2024 15:25:44 +0000 (16:25 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Dec 2024 15:18:40 +0000 (16:18 +0100)
* src/frame.c (frame_inhibit_resize): Under GTK do not inhibit
implied resizing as long as the tool bar has not been drawn yet
so the frame gets its intended initial height (Bug#74750).
* src/gtkutil.c (update_frame_tool_bar): Set tool_bar_resized
slot of frame f to true regardless of whether a tool bar was
made or not.  This will make inhibiting implied resizes work
again from now on.

(cherry picked from commit dbf22fd0d050423e5ed727923399099bba7d3dc2)

src/frame.c
src/gtkutil.c

index 5d9551c0c938d33e92776944fba101b303ba9df7..9b09cbb032cae2b68048ae00fa5a4eb525d1c8d1 100644 (file)
@@ -182,6 +182,9 @@ frame_inhibit_resize (struct frame *f, bool horizontal, Lisp_Object parameter)
   Lisp_Object fullscreen = get_frame_param (f, Qfullscreen);
 
   return (f->after_make_frame
+#ifdef USE_GTK
+         && f->tool_bar_resized
+#endif
          && (EQ (frame_inhibit_implied_resize, Qt)
              || (CONSP (frame_inhibit_implied_resize)
                  && !NILP (Fmemq (parameter, frame_inhibit_implied_resize)))
index d57627f152fcbe622e2eaf4051fc59bfdf01dd8d..daff867af29ef93a3117df34ec1c760e82f311d7 100644 (file)
@@ -6081,13 +6081,13 @@ update_frame_tool_bar (struct frame *f)
         xg_pack_tool_bar (f, FRAME_TOOL_BAR_POSITION (f));
       gtk_widget_show_all (x->toolbar_widget);
       if (xg_update_tool_bar_sizes (f))
-       /* It's not entirely clear whether here we want a treatment
-          similar to that for frames with internal tool bar.  */
-       adjust_frame_size (f, -1, -1, 2, 0, Qtool_bar_lines);
-
-      f->tool_bar_resized = f->tool_bar_redisplayed;
+       adjust_frame_size (f, -1, -1, 2, false, Qtool_bar_lines);
     }
 
+  /* Set this regardless of whether a tool bar was made or not.  It's
+     needed for 'frame-inhibit-implied-resize' to work on GTK.  */
+  f->tool_bar_resized = true;
+
   unblock_input ();
 }