diff options
| author | Jim Blandy | 1992-09-13 12:54:09 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-09-13 12:54:09 +0000 |
| commit | b0342f1711645d3ee55b7fc19cb2f72514f7f30f (patch) | |
| tree | 2b968a42bccbcfdae49bcace054dd3cb54ef66a6 /src | |
| parent | dfc35f5fca6653357bbc8f1582aa86e65877267c (diff) | |
| download | emacs-b0342f1711645d3ee55b7fc19cb2f72514f7f30f.tar.gz emacs-b0342f1711645d3ee55b7fc19cb2f72514f7f30f.zip | |
* 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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c index 25c63512e13..956e784bf0f 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -3517,14 +3517,38 @@ x_wm_set_size_hint (f, prompting) | |||
| 3517 | (x_screen_height - ((2 * f->display.x->internal_border_width) | 3517 | (x_screen_height - ((2 * f->display.x->internal_border_width) |
| 3518 | + f->display.x->h_scrollbar_height)); | 3518 | + f->display.x->h_scrollbar_height)); |
| 3519 | { | 3519 | { |
| 3520 | int min_rows = 0, min_cols = 0; | 3520 | int base_width, base_height; |
| 3521 | check_frame_size (f, &min_rows, &min_cols); | 3521 | |
| 3522 | size_hints.min_width = ((2 * f->display.x->internal_border_width) | 3522 | base_width = ((2 * f->display.x->internal_border_width) |
| 3523 | + min_cols * size_hints.width_inc | 3523 | + f->display.x->v_scrollbar_width); |
| 3524 | + f->display.x->v_scrollbar_width); | 3524 | base_height = ((2 * f->display.x->internal_border_width) |
| 3525 | size_hints.min_height = ((2 * f->display.x->internal_border_width) | 3525 | + f->display.x->h_scrollbar_height); |
| 3526 | + min_rows * size_hints.height_inc | 3526 | |
| 3527 | + f->display.x->h_scrollbar_height); | 3527 | { |
| 3528 | int min_rows = 0, min_cols = 0; | ||
| 3529 | check_frame_size (f, &min_rows, &min_cols); | ||
| 3530 | |||
| 3531 | /* The window manager uses the base width hints to calculate the | ||
| 3532 | current number of rows and columns in the frame while | ||
| 3533 | resizing; min_width and min_height aren't useful for this | ||
| 3534 | purpose, since they might not give the dimensions for a | ||
| 3535 | zero-row, zero-column frame. | ||
| 3536 | |||
| 3537 | We use the base_width and base_height members if we have | ||
| 3538 | them; otherwise, we set the min_width and min_height members | ||
| 3539 | to the size for a zero x zero frame. */ | ||
| 3540 | |||
| 3541 | #ifdef HAVE_X11R4 | ||
| 3542 | size_hints.flags |= PBaseSize; | ||
| 3543 | size_hints.base_width = base_width; | ||
| 3544 | size_hints.base_height = base_height; | ||
| 3545 | size_hints.min_width = base_width + min_cols * size_hints.width_inc; | ||
| 3546 | size_hints.min_height = base_height + min_rows * size_hints.height_inc; | ||
| 3547 | #else | ||
| 3548 | size_hints.min_width = base_width; | ||
| 3549 | size_hints.min_height = base_height; | ||
| 3550 | #endif | ||
| 3551 | } | ||
| 3528 | 3552 | ||
| 3529 | } | 3553 | } |
| 3530 | 3554 | ||
| @@ -3545,7 +3569,11 @@ x_wm_set_size_hint (f, prompting) | |||
| 3545 | size_hints.flags |= USSize; | 3569 | size_hints.flags |= USSize; |
| 3546 | } | 3570 | } |
| 3547 | 3571 | ||
| 3572 | #ifdef HAVE_X11R4 | ||
| 3573 | XSetWMNormalHints (x_current_display, window, &size_hints); | ||
| 3574 | #else | ||
| 3548 | XSetNormalHints (x_current_display, window, &size_hints); | 3575 | XSetNormalHints (x_current_display, window, &size_hints); |
| 3576 | #endif | ||
| 3549 | } | 3577 | } |
| 3550 | 3578 | ||
| 3551 | /* Used for IconicState or NormalState */ | 3579 | /* Used for IconicState or NormalState */ |