diff --git a/src/gtkutil.c b/src/gtkutil.c index 6308c38f16..0b2f597c2b 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -953,6 +953,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height) int totalheight = pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f); int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f); + bool was_visible = false; if (FRAME_PIXEL_HEIGHT (f) == 0) return; @@ -1001,8 +1002,28 @@ xg_frame_set_char_size (struct frame *f, int width, int height) (f, Qxg_frame_set_char_size_3, width, height, list2i (totalwidth, totalheight)); + if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f) + && x_gtk_hide_child_frame_during_resize) + { + was_visible = true; + block_input (); + gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f)); + unblock_input (); + } + gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), totalwidth, totalheight); + + if (was_visible) + { + block_input (); + gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f)); + /* Let's hope the following is not needed. */ +/** XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), **/ +/** f->left_pos, f->top_pos); **/ + unblock_input (); + } + fullscreen = Qnil; } @@ -1016,7 +1037,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height) size as fast as possible. For unmapped windows, we can set rows/cols. When the frame is mapped again we will (hopefully) get the correct size. */ - if (FRAME_VISIBLE_P (f)) + if (FRAME_VISIBLE_P (f) && !was_visible) { /* Must call this to flush out events */ (void)gtk_events_pending (); diff --git a/src/xterm.c b/src/xterm.c index 21d99f0c7b..95109baf46 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -13747,4 +13747,9 @@ syms_of_xterm (void) consuming frame position adjustments. In newer versions of GTK, Emacs always uses gtk_window_move and ignores the value of this variable. */); x_gtk_use_window_move = true; + + DEFVAR_BOOL ("x-gtk-hide-child-frame-during-resize", x_gtk_hide_child_frame_during_resize, + doc: /* Non-nil means hide child frame during resize. +Set this only if your window manager refuses to resize child frames. */); + x_gtk_hide_child_frame_during_resize = false; }