emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master dbf22fd0d05: On GTK do not inhibit implied resizing until tool ba


From: Martin Rudalics
Subject: master dbf22fd0d05: On GTK do not inhibit implied resizing until tool bar was drawn (Bug#74750)
Date: Fri, 20 Dec 2024 10:28:39 -0500 (EST)

branch: master
commit dbf22fd0d050423e5ed727923399099bba7d3dc2
Author: Martin Rudalics <rudalics@gmx.at>
Commit: Martin Rudalics <rudalics@gmx.at>

    On GTK do not inhibit implied resizing until tool bar was drawn (Bug#74750)
    
    * 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.
---
 src/frame.c   |  3 +++
 src/gtkutil.c | 10 +++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/frame.c b/src/frame.c
index 431b04fc34e..36b314c075e 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -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)))
diff --git a/src/gtkutil.c b/src/gtkutil.c
index d57627f152f..daff867af29 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -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 ();
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]