diff --git a/src/gtkutil.c b/src/gtkutil.c index 6308c38f16..a77810141a 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -997,12 +997,13 @@ xg_frame_set_char_size (struct frame *f, int width, int height) } else { + GdkWindow *gwin = gtk_widget_get_window (FRAME_GTK_OUTER_WIDGET (f)); + frame_size_history_add (f, Qxg_frame_set_char_size_3, width, height, list2i (totalwidth, totalheight)); - gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - totalwidth, totalheight); + gdk_window_resize (gwin, (gint)totalwidth, (gint)totalheight); fullscreen = Qnil; } diff --git a/src/xfns.c b/src/xfns.c index 276ea1c393..cfe4e7a2c0 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4125,6 +4125,9 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, x_wm_set_size_hint (f, window_prompting, false); unblock_input (); + if (FRAME_PARENT_FRAME (f) && x_resize_child_frame_special) + adjust_frame_size (f, 1000, 1000, 0, true, Qx_create_frame_2); + adjust_frame_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT_HEIGHT (f), 0, true, Qx_create_frame_2); diff --git a/src/xterm.c b/src/xterm.c index 21d99f0c7b..84b154f8fc 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8953,6 +8953,23 @@ handle_one_xevent (struct x_display_info *dpyinfo, #ifdef USE_CAIRO x_cr_update_surface_desired_size (f, configureEvent.xconfigure.width, configureEvent.xconfigure.height); +#endif + f = 0; + } + else if (f && FRAME_PARENT_FRAME (f) + && x_resize_child_frame_special + && (configureEvent.xconfigure.width != FRAME_PIXEL_WIDTH (f) + || configureEvent.xconfigure.height != FRAME_PIXEL_HEIGHT (f))) + { + block_input (); + if (FRAME_X_DOUBLE_BUFFERED_P (f)) + font_drop_xrender_surfaces (f); + unblock_input (); + xg_frame_resized (f, configureEvent.xconfigure.width, + configureEvent.xconfigure.height); +#ifdef USE_CAIRO + x_cr_update_surface_desired_size (f, configureEvent.xconfigure.width, + configureEvent.xconfigure.height); #endif f = 0; } @@ -13747,4 +13764,10 @@ 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-resize-child-frame-special", x_resize_child_frame_special, + doc: /* Non-nil means treat child frames specially during resizing. +Set this if and only if your window manager refuses to resize child +frames as expected. */); + x_resize_child_frame_special = false; }