1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

Speed up 'resize-mode' child frames a little

* src/gtkutil.c (xg_frame_set_char_size): Skip resizing if the
target dimensions are unchanged for child frames with
'resize-mode' resize policy as well.
This commit is contained in:
Dmitry Gutov 2020-04-08 13:52:40 +03:00
parent f451ef9308
commit 08486f4cae

View File

@ -954,6 +954,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
= pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f);
int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f);
bool was_visible = false;
bool hide_child_frame;
if (FRAME_PIXEL_HEIGHT (f) == 0)
return;
@ -996,26 +997,33 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
totalwidth, gheight);
}
else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f)
&& EQ (x_gtk_resize_child_frames, Qhide))
else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f))
{
was_visible = true;
hide_child_frame = EQ (x_gtk_resize_child_frames, Qhide);
if (totalwidth != gwidth || totalheight != gheight)
{
frame_size_history_add
(f, Qxg_frame_set_char_size_4, width, height,
list2i (totalwidth, totalheight));
block_input ();
gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f));
unblock_input ();
if (hide_child_frame)
{
block_input ();
gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f));
unblock_input ();
}
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
totalwidth, totalheight);
block_input ();
gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
unblock_input ();
if (hide_child_frame)
{
block_input ();
gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
unblock_input ();
}
fullscreen = Qnil;
}