… | |
… | |
525 | */ |
525 | */ |
526 | void |
526 | void |
527 | rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight) |
527 | rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight) |
528 | { |
528 | { |
529 | short recalc_x, recalc_y; |
529 | short recalc_x, recalc_y; |
530 | int x, y, sb_w, flags; |
530 | int x, y, flags; |
531 | unsigned int w, h; |
531 | unsigned int w, h; |
532 | unsigned int max_width, max_height; |
532 | unsigned int max_width, max_height; |
533 | |
533 | |
534 | szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; |
534 | szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; |
535 | szHint.win_gravity = NorthWestGravity; |
535 | szHint.win_gravity = NorthWestGravity; |
… | |
… | |
592 | max_width = MAX_COLS * fwidth; |
592 | max_width = MAX_COLS * fwidth; |
593 | max_height = MAX_ROWS * fheight; |
593 | max_height = MAX_ROWS * fheight; |
594 | |
594 | |
595 | szHint.base_width = szHint.base_height = 2 * int_bwidth; |
595 | szHint.base_width = szHint.base_height = 2 * int_bwidth; |
596 | |
596 | |
597 | sb_w = 0; |
|
|
598 | window_vt_x = window_vt_y = int_bwidth; |
597 | window_vt_x = window_vt_y = int_bwidth; |
599 | |
598 | |
600 | if (scrollBar.state) |
599 | if (scrollBar.state) |
601 | { |
600 | { |
602 | sb_w = scrollBar.total_width (); |
601 | int sb_w = scrollBar.total_width (); |
603 | szHint.base_width += sb_w; |
602 | szHint.base_width += sb_w; |
604 | |
603 | |
605 | if (!option (Opt_scrollBar_right)) |
604 | if (!option (Opt_scrollBar_right)) |
606 | window_vt_x += sb_w; |
605 | window_vt_x += sb_w; |
607 | } |
606 | } |
… | |
… | |
630 | else |
629 | else |
631 | { |
630 | { |
632 | min_it (height, max_height); |
631 | min_it (height, max_height); |
633 | szHint.height = szHint.base_height + height; |
632 | szHint.height = szHint.base_height + height; |
634 | } |
633 | } |
635 | |
|
|
636 | if (scrollBar.state && option (Opt_scrollBar_right)) |
|
|
637 | window_sb_x = szHint.width - sb_w; |
|
|
638 | |
634 | |
639 | if (recalc_x) |
635 | if (recalc_x) |
640 | szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; |
636 | szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; |
641 | |
637 | |
642 | if (recalc_y) |
638 | if (recalc_y) |
… | |
… | |
982 | fix_screen = ncol != prev_ncol || nrow != prev_nrow; |
978 | fix_screen = ncol != prev_ncol || nrow != prev_nrow; |
983 | |
979 | |
984 | if (fix_screen || newwidth != old_width || newheight != old_height) |
980 | if (fix_screen || newwidth != old_width || newheight != old_height) |
985 | { |
981 | { |
986 | if (scrollBar.state) |
982 | if (scrollBar.state) |
987 | { |
|
|
988 | XMoveResizeWindow (dpy, scrollBar.win, |
|
|
989 | window_sb_x, 0, |
|
|
990 | scrollBar.total_width (), szHint.height); |
|
|
991 | resize_scrollbar (); |
983 | resize_scrollbar (); |
992 | } |
|
|
993 | |
984 | |
994 | XMoveResizeWindow (dpy, vt, |
985 | XMoveResizeWindow (dpy, vt, |
995 | window_vt_x, window_vt_y, |
986 | window_vt_x, window_vt_y, |
996 | width, height); |
987 | width, height); |
997 | |
988 | |