summaryrefslogtreecommitdiff
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2020-04-11 07:50:12 -0700
committerGlenn Morris <rgm@gnu.org>2020-04-11 07:50:12 -0700
commit1988ffbaed709dfc71126efbf06644476830f07e (patch)
treefdc98855a3ab7bf6d6cb4c8826ec4a9dfc603d33 /src/gtkutil.c
parentb902d7c9d07b2cc951fa5c789d585d65366d19d2 (diff)
parentfd27685c1e68e742abf1698573dac53743f15e48 (diff)
downloademacs-1988ffbaed709dfc71126efbf06644476830f07e.tar.gz
Merge from origin/emacs-27
fd27685c1e (origin/emacs-27) ; * doc/lispref/keymaps.texi (Extended M... 6057d79a4e * doc/lispref/keymaps.texi (Extended Menu Items): Tweak :k... 17a1bb5a03 Fix redisplay when scrolling under redisplay-dont-pause 90321f595c Fix face extension in pulse.el 36c42d2a30 * doc/misc/tramp.texi (Bug Reports): Avoid line breaks in ... d5750af151 Avoid assertion violation in intervals.c 18d1bc0a09 Improve documentation of 'jit-lock-contextually' 08486f4cae Speed up 'resize-mode' child frames a little f451ef9308 ; * etc/NEWS: Mention 'executing-macro' in removed vars. c49d379f17 Fix some problems with moving and resizing child frames # Conflicts: # etc/NEWS
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r--src/gtkutil.c41
1 files changed, 36 insertions, 5 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 338c6036c2c..681f86f51ba 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -941,9 +941,8 @@ xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight)
}
}
-/* Resize the outer window of frame F after changing the height.
- COLUMNS/ROWS is the size the edit area shall have after the resize. */
-
+/** Resize the outer window of frame F. WIDTH and HEIGHT are the new
+ pixel sizes of F's text area. */
void
xg_frame_set_char_size (struct frame *f, int width, int height)
{
@@ -954,6 +953,8 @@ 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;
+ bool hide_child_frame;
if (FRAME_PIXEL_HEIGHT (f) == 0)
return;
@@ -996,12 +997,42 @@ 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))
+ {
+ 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));
+
+ 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);
+
+ if (hide_child_frame)
+ {
+ block_input ();
+ gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
+ unblock_input ();
+ }
+
+ fullscreen = Qnil;
+ }
+ }
else
{
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);
fullscreen = Qnil;
@@ -1017,7 +1048,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 ();