aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/src/xterm.c b/src/xterm.c
index dd57a548393..fdf0eee689f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -9579,6 +9579,10 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
9579{ 9579{
9580 struct font *font = XFONT_OBJECT (font_object); 9580 struct font *font = XFONT_OBJECT (font_object);
9581 int unit, font_ascent, font_descent; 9581 int unit, font_ascent, font_descent;
9582#ifndef USE_X_TOOLKIT
9583 int old_menu_bar_height = FRAME_MENU_BAR_HEIGHT (f);
9584 Lisp_Object fullscreen;
9585#endif
9582 9586
9583 if (fontset < 0) 9587 if (fontset < 0)
9584 fontset = fontset_from_font (font_object); 9588 fontset = fontset_from_font (font_object);
@@ -9615,9 +9619,25 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
9615 doing it because it's done in Fx_show_tip, and it leads to 9619 doing it because it's done in Fx_show_tip, and it leads to
9616 problems because the tip frame has no widget. */ 9620 problems because the tip frame has no widget. */
9617 if (NILP (tip_frame) || XFRAME (tip_frame) != f) 9621 if (NILP (tip_frame) || XFRAME (tip_frame) != f)
9622 {
9618 adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f), 9623 adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
9619 FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3, 9624 FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3,
9620 false, Qfont); 9625 false, Qfont);
9626#ifndef USE_X_TOOLKIT
9627 if (FRAME_MENU_BAR_HEIGHT (f) != old_menu_bar_height
9628 && !f->after_make_frame
9629 && (EQ (frame_inhibit_implied_resize, Qt)
9630 || (CONSP (frame_inhibit_implied_resize)
9631 && NILP (Fmemq (Qfont, frame_inhibit_implied_resize))))
9632 && (NILP (fullscreen = get_frame_param (f, Qfullscreen))
9633 || EQ (fullscreen, Qfullwidth)))
9634 /* If the menu bar height changes, try to keep text height
9635 constant. */
9636 adjust_frame_size
9637 (f, -1, FRAME_TEXT_HEIGHT (f) + FRAME_MENU_BAR_HEIGHT (f)
9638 - old_menu_bar_height, 1, false, Qfont);
9639#endif /* USE_X_TOOLKIT */
9640 }
9621 } 9641 }
9622 9642
9623#ifdef HAVE_X_I18N 9643#ifdef HAVE_X_I18N
@@ -10549,7 +10569,7 @@ x_set_window_size_1 (struct frame *f, bool change_gravity,
10549 if (EQ (fullscreen, Qfullwidth) && width == FRAME_TEXT_WIDTH (f)) 10569 if (EQ (fullscreen, Qfullwidth) && width == FRAME_TEXT_WIDTH (f))
10550 { 10570 {
10551 frame_size_history_add 10571 frame_size_history_add
10552 (f, Qxg_frame_set_char_size_1, width, height, 10572 (f, Qx_set_window_size_1, width, height,
10553 list2 (make_number (old_height), 10573 list2 (make_number (old_height),
10554 make_number (pixelheight + FRAME_MENUBAR_HEIGHT (f)))); 10574 make_number (pixelheight + FRAME_MENUBAR_HEIGHT (f))));
10555 10575
@@ -10559,7 +10579,7 @@ x_set_window_size_1 (struct frame *f, bool change_gravity,
10559 else if (EQ (fullscreen, Qfullheight) && height == FRAME_TEXT_HEIGHT (f)) 10579 else if (EQ (fullscreen, Qfullheight) && height == FRAME_TEXT_HEIGHT (f))
10560 { 10580 {
10561 frame_size_history_add 10581 frame_size_history_add
10562 (f, Qxg_frame_set_char_size_2, width, height, 10582 (f, Qx_set_window_size_2, width, height,
10563 list2 (make_number (old_width), make_number (pixelwidth))); 10583 list2 (make_number (old_width), make_number (pixelwidth)));
10564 10584
10565 XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 10585 XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
@@ -10569,10 +10589,11 @@ x_set_window_size_1 (struct frame *f, bool change_gravity,
10569 else 10589 else
10570 { 10590 {
10571 frame_size_history_add 10591 frame_size_history_add
10572 (f, Qxg_frame_set_char_size_3, width, height, 10592 (f, Qx_set_window_size_3, width, height,
10573 list2 (make_number (pixelwidth + FRAME_TOOLBAR_WIDTH (f)), 10593 list3 (make_number (pixelwidth + FRAME_TOOLBAR_WIDTH (f)),
10574 make_number (pixelheight + FRAME_TOOLBAR_HEIGHT (f) 10594 make_number (pixelheight + FRAME_TOOLBAR_HEIGHT (f)
10575 + FRAME_MENUBAR_HEIGHT (f)))); 10595 + FRAME_MENUBAR_HEIGHT (f)),
10596 make_number (FRAME_MENUBAR_HEIGHT (f))));
10576 10597
10577 XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 10598 XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
10578 pixelwidth, pixelheight + FRAME_MENUBAR_HEIGHT (f)); 10599 pixelwidth, pixelheight + FRAME_MENUBAR_HEIGHT (f));
@@ -11342,8 +11363,8 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
11342 size_hints.x = f->left_pos; 11363 size_hints.x = f->left_pos;
11343 size_hints.y = f->top_pos; 11364 size_hints.y = f->top_pos;
11344 11365
11345 size_hints.height = FRAME_PIXEL_HEIGHT (f);
11346 size_hints.width = FRAME_PIXEL_WIDTH (f); 11366 size_hints.width = FRAME_PIXEL_WIDTH (f);
11367 size_hints.height = FRAME_PIXEL_HEIGHT (f);
11347 11368
11348 size_hints.width_inc = frame_resize_pixelwise ? 1 : FRAME_COLUMN_WIDTH (f); 11369 size_hints.width_inc = frame_resize_pixelwise ? 1 : FRAME_COLUMN_WIDTH (f);
11349 size_hints.height_inc = frame_resize_pixelwise ? 1 : FRAME_LINE_HEIGHT (f); 11370 size_hints.height_inc = frame_resize_pixelwise ? 1 : FRAME_LINE_HEIGHT (f);
@@ -11356,34 +11377,21 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
11356 /* Calculate the base and minimum sizes. */ 11377 /* Calculate the base and minimum sizes. */
11357 { 11378 {
11358 int base_width, base_height; 11379 int base_width, base_height;
11359 int min_rows = 0, min_cols = 0;
11360 11380
11361 base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0); 11381 base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
11362 base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0); 11382 base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
11363 11383
11364 if (frame_resize_pixelwise)
11365 /* Needed to prevent a bad protocol error crash when making the
11366 frame size very small. */
11367 {
11368 min_cols = 2 * min_cols;
11369 min_rows = 2 * min_rows;
11370 }
11371
11372 /* The window manager uses the base width hints to calculate the 11384 /* The window manager uses the base width hints to calculate the
11373 current number of rows and columns in the frame while 11385 current number of rows and columns in the frame while
11374 resizing; min_width and min_height aren't useful for this 11386 resizing; min_width and min_height aren't useful for this
11375 purpose, since they might not give the dimensions for a 11387 purpose, since they might not give the dimensions for a
11376 zero-row, zero-column frame. 11388 zero-row, zero-column frame. */
11377
11378 We use the base_width and base_height members if we have
11379 them; otherwise, we set the min_width and min_height members
11380 to the size for a zero x zero frame. */
11381 11389
11382 size_hints.flags |= PBaseSize; 11390 size_hints.flags |= PBaseSize;
11383 size_hints.base_width = base_width; 11391 size_hints.base_width = base_width;
11384 size_hints.base_height = base_height + FRAME_MENUBAR_HEIGHT (f); 11392 size_hints.base_height = base_height + FRAME_MENUBAR_HEIGHT (f);
11385 size_hints.min_width = base_width + min_cols * FRAME_COLUMN_WIDTH (f); 11393 size_hints.min_width = base_width;
11386 size_hints.min_height = base_height + min_rows * FRAME_LINE_HEIGHT (f); 11394 size_hints.min_height = base_height;
11387 } 11395 }
11388 11396
11389 /* If we don't need the old flags, we don't need the old hint at all. */ 11397 /* If we don't need the old flags, we don't need the old hint at all. */