aboutsummaryrefslogtreecommitdiffstats
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorGlenn Morris2020-04-11 07:50:12 -0700
committerGlenn Morris2020-04-11 07:50:12 -0700
commit1988ffbaed709dfc71126efbf06644476830f07e (patch)
treefdc98855a3ab7bf6d6cb4c8826ec4a9dfc603d33 /src/gtkutil.c
parentb902d7c9d07b2cc951fa5c789d585d65366d19d2 (diff)
parentfd27685c1e68e742abf1698573dac53743f15e48 (diff)
downloademacs-1988ffbaed709dfc71126efbf06644476830f07e.tar.gz
emacs-1988ffbaed709dfc71126efbf06644476830f07e.zip
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)
941 } 941 }
942} 942}
943 943
944/* Resize the outer window of frame F after changing the height. 944/** Resize the outer window of frame F. WIDTH and HEIGHT are the new
945 COLUMNS/ROWS is the size the edit area shall have after the resize. */ 945 pixel sizes of F's text area. */
946
947void 946void
948xg_frame_set_char_size (struct frame *f, int width, int height) 947xg_frame_set_char_size (struct frame *f, int width, int height)
949{ 948{
@@ -954,6 +953,8 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
954 int totalheight 953 int totalheight
955 = pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f); 954 = pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f);
956 int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f); 955 int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f);
956 bool was_visible = false;
957 bool hide_child_frame;
957 958
958 if (FRAME_PIXEL_HEIGHT (f) == 0) 959 if (FRAME_PIXEL_HEIGHT (f) == 0)
959 return; 960 return;
@@ -996,12 +997,42 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
996 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 997 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
997 totalwidth, gheight); 998 totalwidth, gheight);
998 } 999 }
1000 else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f))
1001 {
1002 was_visible = true;
1003 hide_child_frame = EQ (x_gtk_resize_child_frames, Qhide);
1004
1005 if (totalwidth != gwidth || totalheight != gheight)
1006 {
1007 frame_size_history_add
1008 (f, Qxg_frame_set_char_size_4, width, height,
1009 list2i (totalwidth, totalheight));
1010
1011 if (hide_child_frame)
1012 {
1013 block_input ();
1014 gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f));
1015 unblock_input ();
1016 }
1017
1018 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
1019 totalwidth, totalheight);
1020
1021 if (hide_child_frame)
1022 {
1023 block_input ();
1024 gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
1025 unblock_input ();
1026 }
1027
1028 fullscreen = Qnil;
1029 }
1030 }
999 else 1031 else
1000 { 1032 {
1001 frame_size_history_add 1033 frame_size_history_add
1002 (f, Qxg_frame_set_char_size_3, width, height, 1034 (f, Qxg_frame_set_char_size_3, width, height,
1003 list2i (totalwidth, totalheight)); 1035 list2i (totalwidth, totalheight));
1004
1005 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 1036 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
1006 totalwidth, totalheight); 1037 totalwidth, totalheight);
1007 fullscreen = Qnil; 1038 fullscreen = Qnil;
@@ -1017,7 +1048,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
1017 size as fast as possible. 1048 size as fast as possible.
1018 For unmapped windows, we can set rows/cols. When 1049 For unmapped windows, we can set rows/cols. When
1019 the frame is mapped again we will (hopefully) get the correct size. */ 1050 the frame is mapped again we will (hopefully) get the correct size. */
1020 if (FRAME_VISIBLE_P (f)) 1051 if (FRAME_VISIBLE_P (f) && !was_visible)
1021 { 1052 {
1022 /* Must call this to flush out events */ 1053 /* Must call this to flush out events */
1023 (void)gtk_events_pending (); 1054 (void)gtk_events_pending ();