Mercurial > hg > xemacs-beta
comparison src/frame.c @ 5078:a04cf0fea770
fix for clipped minibuffer window
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-25 Ben Wing <ben@xemacs.org>
* frame-impl.h:
Create some new macros for more clearly getting the size/edges
of various rectangles surrounding the paned area.
* frame.c (change_frame_size_1):
Use the new macros. Clean up change_frame_size_1 and make sure
the internal border width gets taken into account -- that was what
was causing the clipped bottom and right.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Thu, 25 Feb 2010 06:11:07 -0600 |
parents | 92dc90c0bb40 |
children | 0ca81354c4c7 |
comparison
equal
deleted
inserted
replaced
5077:d372b17f63ce | 5078:a04cf0fea770 |
---|---|
3593 FRAME_NEW_HEIGHT (f) = 0; | 3593 FRAME_NEW_HEIGHT (f) = 0; |
3594 FRAME_NEW_WIDTH (f) = 0; | 3594 FRAME_NEW_WIDTH (f) = 0; |
3595 | 3595 |
3596 /* We need to remove the boundaries of the paned area (see top of file) | 3596 /* We need to remove the boundaries of the paned area (see top of file) |
3597 from the total-area pixel size, which is what we have now. | 3597 from the total-area pixel size, which is what we have now. |
3598 | 3598 */ |
3599 #### We should also be subtracting the internal borders. */ | |
3600 new_pixheight -= | 3599 new_pixheight -= |
3601 (FRAME_REAL_TOP_TOOLBAR_BOUNDS (f) | 3600 (FRAME_NONPANED_SIZE (f, TOP_EDGE) + FRAME_NONPANED_SIZE (f, BOTTOM_EDGE)); |
3602 + FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f) | |
3603 + FRAME_TOP_GUTTER_BOUNDS (f) | |
3604 + FRAME_BOTTOM_GUTTER_BOUNDS (f)); | |
3605 | |
3606 new_pixwidth -= | 3601 new_pixwidth -= |
3607 (FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f) | 3602 (FRAME_NONPANED_SIZE (f, LEFT_EDGE) + FRAME_NONPANED_SIZE (f, RIGHT_EDGE)); |
3608 + FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f) | 3603 |
3609 + FRAME_LEFT_GUTTER_BOUNDS (f) | 3604 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = FRAME_PANED_TOP_EDGE (f); |
3610 + FRAME_RIGHT_GUTTER_BOUNDS (f)); | |
3611 | |
3612 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top | |
3613 = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); | |
3614 | 3605 |
3615 if (FRAME_HAS_MINIBUF_P (f) | 3606 if (FRAME_HAS_MINIBUF_P (f) |
3616 && ! FRAME_MINIBUF_ONLY_P (f)) | 3607 && ! FRAME_MINIBUF_ONLY_P (f)) |
3617 /* Frame has both root and minibuffer. */ | 3608 /* Frame has both root and minibuffer. */ |
3618 { | 3609 { |
3634 set_window_pixheight (FRAME_ROOT_WINDOW (f), | 3625 set_window_pixheight (FRAME_ROOT_WINDOW (f), |
3635 /* - font_height for minibuffer */ | 3626 /* - font_height for minibuffer */ |
3636 new_pixheight - minibuf_height, 0); | 3627 new_pixheight - minibuf_height, 0); |
3637 | 3628 |
3638 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = | 3629 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = |
3639 FRAME_TOP_BORDER_END (f) + | 3630 FRAME_PANED_TOP_EDGE (f) + |
3640 FRAME_TOP_GUTTER_BOUNDS (f) + | |
3641 FRAME_BOTTOM_GUTTER_BOUNDS (f) + | 3631 FRAME_BOTTOM_GUTTER_BOUNDS (f) + |
3642 new_pixheight - minibuf_height; | 3632 new_pixheight - minibuf_height; |
3643 | 3633 |
3644 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); | 3634 set_window_pixheight (FRAME_MINIBUF_WINDOW (f), minibuf_height, 0); |
3645 } | 3635 } |
3649 | 3639 |
3650 FRAME_HEIGHT (f) = newheight; | 3640 FRAME_HEIGHT (f) = newheight; |
3651 if (FRAME_TTY_P (f)) | 3641 if (FRAME_TTY_P (f)) |
3652 f->pixheight = newheight; | 3642 f->pixheight = newheight; |
3653 | 3643 |
3654 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = | 3644 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = FRAME_PANED_LEFT_EDGE (f); |
3655 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); | |
3656 set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); | 3645 set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); |
3657 | 3646 |
3658 if (FRAME_HAS_MINIBUF_P (f)) | 3647 if (FRAME_HAS_MINIBUF_P (f)) |
3659 { | 3648 { |
3660 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = | 3649 XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = |
3661 FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); | 3650 FRAME_PANED_LEFT_EDGE (f); |
3662 set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); | 3651 set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); |
3663 } | 3652 } |
3664 | 3653 |
3665 FRAME_WIDTH (f) = newwidth; | 3654 FRAME_WIDTH (f) = newwidth; |
3666 if (FRAME_TTY_P (f)) | 3655 if (FRAME_TTY_P (f)) |
3667 f->pixwidth = newwidth; | 3656 f->pixwidth = newwidth; |
3668 | 3657 |
3669 /* #### On MS Windows, this references FRAME_PIXWIDTH() and FRAME_PIXHEIGHT(). | 3658 /* #### On MS Windows, this references FRAME_PIXWIDTH() and |
3670 I'm not sure we can count on those values being set. Instead we should | 3659 FRAME_PIXHEIGHT(). I'm not sure we can count on those values being |
3671 use the total pixel size we got near the top by calling | 3660 set. Instead we should use the total pixel size we got near the top |
3672 frame_conversion_internal(). We should inline the logic in | 3661 by calling frame_conversion_internal(). We should inline the logic in |
3673 get_frame_char_size() here and change that function so it just looks | 3662 get_frame_char_size() here and change that function so it just looks |
3674 at FRAME_CHARWIDTH() and FRAME_CHARHEIGHT(). */ | 3663 at FRAME_CHARWIDTH() and FRAME_CHARHEIGHT(). */ |
3675 get_frame_char_size (f, &FRAME_CHARWIDTH (f), &FRAME_CHARHEIGHT (f)); | 3664 get_frame_char_size (f, &FRAME_CHARWIDTH (f), &FRAME_CHARHEIGHT (f)); |
3676 | 3665 |
3677 MARK_FRAME_TOOLBARS_CHANGED (f); | 3666 MARK_FRAME_TOOLBARS_CHANGED (f); |