comparison src/xterm.c @ 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 d6ee6ff7562d
children 74ae34a80f94
comparison
equal deleted inserted replaced
1126:94d76dbb5ce6 1127:cd3d59155bf7
3515 + f->display.x->v_scrollbar_width)); 3515 + f->display.x->v_scrollbar_width));
3516 size_hints.max_height = 3516 size_hints.max_height =
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
3531 if (prompting) 3555 if (prompting)
3532 size_hints.flags |= prompting; 3556 size_hints.flags |= prompting;
3543 size_hints.flags |= USPosition; 3567 size_hints.flags |= USPosition;
3544 if (hints.flags & USSize) 3568 if (hints.flags & USSize)
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 */
3552 x_wm_set_window_state (f, state) 3580 x_wm_set_window_state (f, state)
3553 struct frame *f; 3581 struct frame *f;