[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-27 08486f4: Speed up 'resize-mode' child frames a little
From: |
Dmitry Gutov |
Subject: |
emacs-27 08486f4: Speed up 'resize-mode' child frames a little |
Date: |
Wed, 8 Apr 2020 07:07:02 -0400 (EDT) |
branch: emacs-27
commit 08486f4cae8e209cd70bd13534beff336faffd9e
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
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.
---
src/gtkutil.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/src/gtkutil.c b/src/gtkutil.c
index e374bdb..466cb42 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -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;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-27 08486f4: Speed up 'resize-mode' child frames a little,
Dmitry Gutov <=