Mercurial > hg > xemacs-beta
changeset 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 | d372b17f63ce |
children | aa4cae427255 |
files | src/ChangeLog src/frame-impl.h src/frame.c |
diffstat | 3 files changed, 84 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Thu Feb 25 04:45:13 2010 -0600 +++ b/src/ChangeLog Thu Feb 25 06:11:07 2010 -0600 @@ -1,3 +1,13 @@ +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. + 2010-02-25 Ben Wing <ben@xemacs.org> * EmacsFrame.c (EmacsFrameSetValues):
--- a/src/frame-impl.h Thu Feb 25 04:45:13 2010 -0600 +++ b/src/frame-impl.h Thu Feb 25 06:11:07 2010 -0600 @@ -727,4 +727,66 @@ #define FRAME_RIGHT_BORDER_END(f) \ (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f)) + +/************************************************************************/ +/* frame dimensions defined using toolbars and gutters */ +/************************************************************************/ + +/* Bounds of the area framed by the toolbars is the client area -- + (0, 0) - (FRAME_PIXWIDTH, FRAME_PIXHEIGHT). */ + +/* Bounds of the area framed by the gutters -- inside of the toolbars, + outside of everything else. */ + +#define FRAME_GUTTER_TOP_EDGE(f) \ + FRAME_REAL_TOOLBAR_BOUNDS (f, TOP_EDGE) +#define FRAME_GUTTER_BOTTOM_EDGE(f) \ + (FRAME_PIXHEIGHT (f) - FRAME_REAL_TOOLBAR_BOUNDS (f, BOTTOM_EDGE)) +#define FRAME_GUTTER_LEFT_EDGE(f) \ + FRAME_REAL_TOOLBAR_BOUNDS (f, LEFT_EDGE) +#define FRAME_GUTTER_RIGHT_EDGE(f) \ + (FRAME_PIXWIDTH (f) - FRAME_REAL_TOOLBAR_BOUNDS (f, RIGHT_EDGE)) + +/* Bounds of the area framed by the internal border width -- inside of the + toolbars and gutters. */ + +#define FRAME_INTERNAL_BORDER_TOP_EDGE(f) \ + (FRAME_GUTTER_TOP_EDGE (f) + FRAME_GUTTER_BOUNDS (f, TOP_EDGE)) +#define FRAME_INTERNAL_BORDER_BOTTOM_EDGE(f) \ + (FRAME_GUTTER_BOTTOM_EDGE (f) - FRAME_GUTTER_BOUNDS (f, BOTTOM_EDGE)) +#define FRAME_INTERNAL_BORDER_LEFT_EDGE(f) \ + (FRAME_GUTTER_LEFT_EDGE (f) + FRAME_GUTTER_BOUNDS (f, LEFT_EDGE)) +#define FRAME_INTERNAL_BORDER_RIGHT_EDGE(f) \ + (FRAME_GUTTER_RIGHT_EDGE (f) - FRAME_GUTTER_BOUNDS (f, RIGHT_EDGE)) + +/* These are the bounds of the paned area -- inside of the toolbars, + gutters, and internal border width. The paned area is the same as the + area occupied by windows, including the minibuffer. See long comment in + frame.c. */ + +#define FRAME_PANED_TOP_EDGE(f) \ + (FRAME_INTERNAL_BORDER_TOP_EDGE (f) + FRAME_INTERNAL_BORDER_HEIGHT (f)) +#define FRAME_PANED_BOTTOM_EDGE(f) \ + (FRAME_INTERNAL_BORDER_BOTTOM_EDGE (f) - FRAME_INTERNAL_BORDER_HEIGHT (f)) +#define FRAME_PANED_LEFT_EDGE(f) \ + (FRAME_INTERNAL_BORDER_LEFT_EDGE (f) + FRAME_INTERNAL_BORDER_WIDTH (f)) +#define FRAME_PANED_RIGHT_EDGE(f) \ + (FRAME_INTERNAL_BORDER_RIGHT_EDGE (f) - FRAME_INTERNAL_BORDER_WIDTH (f)) + +/* Thickness of non-paned area at edge of frame; + + FRAME_PANED_TOP_EDGE (f) == FRAME_NONPANED_SIZE (f, TOP_EDGE) + FRAME_PANED_LEFT_EDGE (f) == FRAME_NONPANED_SIZE (f, LEFT_EDGE) + FRAME_PANED_BOTTOM_EDGE (f) == + FRAME_PIXHEIGHT (f) - FRAME_NONPANED_SIZE (f, BOTTOM_EDGE) + FRAME_PANED_RIGHT_EDGE (f) == + FRAME_PIXWIDTH (f) - FRAME_NONPANED_SIZE (f, RIGHT_EDGE) + +*/ +#define FRAME_NONPANED_SIZE(f, pos) \ + (FRAME_REAL_TOOLBAR_BOUNDS (f, pos) + FRAME_GUTTER_BOUNDS (f, pos) + \ + FRAME_INTERNAL_BORDER_SIZE (f, pos)) + + + #endif /* INCLUDED_frame_impl_h_ */
--- a/src/frame.c Thu Feb 25 04:45:13 2010 -0600 +++ b/src/frame.c Thu Feb 25 06:11:07 2010 -0600 @@ -3595,22 +3595,13 @@ /* We need to remove the boundaries of the paned area (see top of file) from the total-area pixel size, which is what we have now. - - #### We should also be subtracting the internal borders. */ + */ new_pixheight -= - (FRAME_REAL_TOP_TOOLBAR_BOUNDS (f) - + FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f) - + FRAME_TOP_GUTTER_BOUNDS (f) - + FRAME_BOTTOM_GUTTER_BOUNDS (f)); - + (FRAME_NONPANED_SIZE (f, TOP_EDGE) + FRAME_NONPANED_SIZE (f, BOTTOM_EDGE)); new_pixwidth -= - (FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f) - + FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f) - + FRAME_LEFT_GUTTER_BOUNDS (f) - + FRAME_RIGHT_GUTTER_BOUNDS (f)); - - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top - = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f); + (FRAME_NONPANED_SIZE (f, LEFT_EDGE) + FRAME_NONPANED_SIZE (f, RIGHT_EDGE)); + + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top = FRAME_PANED_TOP_EDGE (f); if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f)) @@ -3636,8 +3627,7 @@ new_pixheight - minibuf_height, 0); XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top = - FRAME_TOP_BORDER_END (f) + - FRAME_TOP_GUTTER_BOUNDS (f) + + FRAME_PANED_TOP_EDGE (f) + FRAME_BOTTOM_GUTTER_BOUNDS (f) + new_pixheight - minibuf_height; @@ -3651,14 +3641,13 @@ if (FRAME_TTY_P (f)) f->pixheight = newheight; - XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = - FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); + XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = FRAME_PANED_LEFT_EDGE (f); set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0); if (FRAME_HAS_MINIBUF_P (f)) { XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_left = - FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f); + FRAME_PANED_LEFT_EDGE (f); set_window_pixwidth (FRAME_MINIBUF_WINDOW (f), new_pixwidth, 0); } @@ -3666,10 +3655,10 @@ if (FRAME_TTY_P (f)) f->pixwidth = newwidth; - /* #### On MS Windows, this references FRAME_PIXWIDTH() and FRAME_PIXHEIGHT(). - I'm not sure we can count on those values being set. Instead we should - use the total pixel size we got near the top by calling - frame_conversion_internal(). We should inline the logic in + /* #### On MS Windows, this references FRAME_PIXWIDTH() and + FRAME_PIXHEIGHT(). I'm not sure we can count on those values being + set. Instead we should use the total pixel size we got near the top + by calling frame_conversion_internal(). We should inline the logic in get_frame_char_size() here and change that function so it just looks at FRAME_CHARWIDTH() and FRAME_CHARHEIGHT(). */ get_frame_char_size (f, &FRAME_CHARWIDTH (f), &FRAME_CHARHEIGHT (f));