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:
parent
f451ef9308
commit
08486f4cae
1 changed files with 16 additions and 8 deletions
|
@ -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);
|
= pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f);
|
||||||
int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f);
|
int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f);
|
||||||
bool was_visible = false;
|
bool was_visible = false;
|
||||||
|
bool hide_child_frame;
|
||||||
|
|
||||||
if (FRAME_PIXEL_HEIGHT (f) == 0)
|
if (FRAME_PIXEL_HEIGHT (f) == 0)
|
||||||
return;
|
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)),
|
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
|
||||||
totalwidth, gheight);
|
totalwidth, gheight);
|
||||||
}
|
}
|
||||||
else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f)
|
else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f))
|
||||||
&& EQ (x_gtk_resize_child_frames, Qhide))
|
|
||||||
{
|
{
|
||||||
was_visible = true;
|
was_visible = true;
|
||||||
|
hide_child_frame = EQ (x_gtk_resize_child_frames, Qhide);
|
||||||
|
|
||||||
if (totalwidth != gwidth || totalheight != gheight)
|
if (totalwidth != gwidth || totalheight != gheight)
|
||||||
{
|
{
|
||||||
frame_size_history_add
|
frame_size_history_add
|
||||||
(f, Qxg_frame_set_char_size_4, width, height,
|
(f, Qxg_frame_set_char_size_4, width, height,
|
||||||
list2i (totalwidth, totalheight));
|
list2i (totalwidth, totalheight));
|
||||||
block_input ();
|
|
||||||
gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f));
|
if (hide_child_frame)
|
||||||
unblock_input ();
|
{
|
||||||
|
block_input ();
|
||||||
|
gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f));
|
||||||
|
unblock_input ();
|
||||||
|
}
|
||||||
|
|
||||||
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
|
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
|
||||||
totalwidth, totalheight);
|
totalwidth, totalheight);
|
||||||
|
|
||||||
block_input ();
|
if (hide_child_frame)
|
||||||
gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
|
{
|
||||||
unblock_input ();
|
block_input ();
|
||||||
|
gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
|
||||||
|
unblock_input ();
|
||||||
|
}
|
||||||
|
|
||||||
fullscreen = Qnil;
|
fullscreen = Qnil;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue