comparison src/frame.c @ 153:25f70ba0133c r20-3b3

Import from CVS: tag r20-3b3
author cvs
date Mon, 13 Aug 2007 09:38:25 +0200
parents 59463afc5666
children 43dd3413c7c7
comparison
equal deleted inserted replaced
152:4c132ee2d62b 153:25f70ba0133c
2635 if (in_display) 2635 if (in_display)
2636 abort (); 2636 abort ();
2637 2637
2638 XSETFRAME (frame, f); 2638 XSETFRAME (frame, f);
2639 2639
2640 /*
2641 * If the frame has been initialized and the new height and width
2642 * are the same as the current height and width, then just return.
2643 */
2644 if (f->init_finished &&
2645 newheight == FRAME_HEIGHT (f) && newwidth == FRAME_WIDTH (f))
2646 return;
2647
2648 default_face_height_and_width (frame, &font_height, &font_width); 2640 default_face_height_and_width (frame, &font_height, &font_width);
2649 2641
2650 /* This size-change overrides any pending one for this frame. */ 2642 /* This size-change overrides any pending one for this frame. */
2651 FRAME_NEW_HEIGHT (f) = 0; 2643 FRAME_NEW_HEIGHT (f) = 0;
2652 FRAME_NEW_WIDTH (f) = 0; 2644 FRAME_NEW_WIDTH (f) = 0;
2700 2692
2701 if (FRAME_HAS_MINIBUF_P (f) 2693 if (FRAME_HAS_MINIBUF_P (f)
2702 && ! FRAME_MINIBUF_ONLY_P (f)) 2694 && ! FRAME_MINIBUF_ONLY_P (f))
2703 /* Frame has both root and minibuffer. */ 2695 /* Frame has both root and minibuffer. */
2704 { 2696 {
2697 /*
2698 * Leave the minibuffer height the same if the frame has
2699 * been initialized, and the minibuffer height is tall
2700 * enough to display at least one line of text in the default
2701 * font, and the old minibuffer height is a multiple of the
2702 * default font height. This should cause the minibuffer
2703 * height to be recomputed on font changes but not for
2704 * other frame size changes, which seems reasonable.
2705 */
2706 int old_minibuf_height =
2707 XWINDOW(FRAME_MINIBUF_WINDOW(f))->pixel_height;
2708 int minibuf_height =
2709 f->init_finished && (old_minibuf_height % font_height) == 0 ?
2710 max(old_minibuf_height, font_height) :
2711 font_height;
2705 set_window_pixheight (FRAME_ROOT_WINDOW (f), 2712 set_window_pixheight (FRAME_ROOT_WINDOW (f),
2706 /* - font_height for minibuffer */ 2713 /* - font_height for minibuffer */
2707 new_pixheight - font_height, 0); 2714 new_pixheight - minibuf_height, 0);
2708 2715
2709 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = 2716 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top =
2710 new_pixheight - font_height + FRAME_TOP_BORDER_END (f); 2717 new_pixheight - minibuf_height + FRAME_TOP_BORDER_END (f);
2711 2718
2712 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), font_height, 0); 2719 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0);
2713 } 2720 }
2714 else 2721 else
2715 /* Frame has just one top-level window. */ 2722 /* Frame has just one top-level window. */
2716 set_window_pixheight (FRAME_ROOT_WINDOW (f), new_pixheight, 0); 2723 set_window_pixheight (FRAME_ROOT_WINDOW (f), new_pixheight, 0);
2717 2724