Mercurial > emacs
changeset 1127:cd3d59155bf7
* xterm.c (x_wm_set_size_hint): Set the base_width and base_height
members of size_hints, if they're available (X11R4 and after);
otherwise, approximate the right thing, by using min_width and
min_height as the base size.
* xterm.c (x_catch_errors): Don't forget to initialize
x_caught_error_message to the null string, so x_check_errors can
tell when an error has occurred.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Sun, 13 Sep 1992 12:54:09 +0000 |
parents | 94d76dbb5ce6 |
children | 2a2dabcf877b |
files | src/xterm.c |
diffstat | 1 files changed, 36 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xterm.c Sun Sep 13 12:48:38 1992 +0000 +++ b/src/xterm.c Sun Sep 13 12:54:09 1992 +0000 @@ -3517,14 +3517,38 @@ (x_screen_height - ((2 * f->display.x->internal_border_width) + f->display.x->h_scrollbar_height)); { - int min_rows = 0, min_cols = 0; - check_frame_size (f, &min_rows, &min_cols); - size_hints.min_width = ((2 * f->display.x->internal_border_width) - + min_cols * size_hints.width_inc - + f->display.x->v_scrollbar_width); - size_hints.min_height = ((2 * f->display.x->internal_border_width) - + min_rows * size_hints.height_inc - + f->display.x->h_scrollbar_height); + int base_width, base_height; + + base_width = ((2 * f->display.x->internal_border_width) + + f->display.x->v_scrollbar_width); + base_height = ((2 * f->display.x->internal_border_width) + + f->display.x->h_scrollbar_height); + + { + int min_rows = 0, min_cols = 0; + check_frame_size (f, &min_rows, &min_cols); + + /* The window manager uses the base width hints to calculate the + current number of rows and columns in the frame while + resizing; min_width and min_height aren't useful for this + purpose, since they might not give the dimensions for a + zero-row, zero-column frame. + + We use the base_width and base_height members if we have + them; otherwise, we set the min_width and min_height members + to the size for a zero x zero frame. */ + +#ifdef HAVE_X11R4 + size_hints.flags |= PBaseSize; + size_hints.base_width = base_width; + size_hints.base_height = base_height; + size_hints.min_width = base_width + min_cols * size_hints.width_inc; + size_hints.min_height = base_height + min_rows * size_hints.height_inc; +#else + size_hints.min_width = base_width; + size_hints.min_height = base_height; +#endif + } } @@ -3545,7 +3569,11 @@ size_hints.flags |= USSize; } +#ifdef HAVE_X11R4 + XSetWMNormalHints (x_current_display, window, &size_hints); +#else XSetNormalHints (x_current_display, window, &size_hints); +#endif } /* Used for IconicState or NormalState */