From 3b4ea7f7d74556f8b868e162be6ded1c700ba160 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 20 Dec 2024 16:25:44 +0100 Subject: [PATCH] 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. (cherry picked from commit dbf22fd0d050423e5ed727923399099bba7d3dc2) --- 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 5d9551c0c93..9b09cbb032c 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 (); } -- 2.39.5