diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2020-04-08 13:52:40 +0300 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2020-04-08 13:52:40 +0300 |
commit | 08486f4cae8e209cd70bd13534beff336faffd9e (patch) | |
tree | ed21f9cff3b0a939dc49cc9061a2dcb3d28e8274 | |
parent | f451ef9308838ee2745b89c5c5739a32b2741128 (diff) | |
download | emacs-08486f4cae8e209cd70bd13534beff336faffd9e.tar.gz |
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.
-rw-r--r-- | src/gtkutil.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index e374bdbe037..466cb42c7ee 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; } |