… | |
… | |
31 | *---------------------------------------------------------------------*/ |
31 | *---------------------------------------------------------------------*/ |
32 | |
32 | |
33 | #include "../config.h" /* NECESSARY */ |
33 | #include "../config.h" /* NECESSARY */ |
34 | #include "rxvt.h" /* NECESSARY */ |
34 | #include "rxvt.h" /* NECESSARY */ |
35 | |
35 | |
|
|
36 | #include <limits> |
|
|
37 | |
36 | #include <csignal> |
38 | #include <csignal> |
37 | #include <cstring> |
39 | #include <cstring> |
38 | |
40 | |
39 | #ifdef TTY_GID_SUPPORT |
41 | #ifdef TTY_GID_SUPPORT |
40 | # include <grp.h> |
42 | # include <grp.h> |
… | |
… | |
718 | if (rs[Rs_geometry]) |
720 | if (rs[Rs_geometry]) |
719 | flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); |
721 | flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); |
720 | |
722 | |
721 | if (flags & WidthValue) |
723 | if (flags & WidthValue) |
722 | { |
724 | { |
723 | ncol = BOUND_POSITIVE_INT16 (w); |
725 | ncol = clamp (w, 0, std::numeric_limits<int16_t>::max ()); |
724 | szHint.flags |= USSize; |
726 | szHint.flags |= USSize; |
725 | } |
727 | } |
726 | |
728 | |
727 | if (flags & HeightValue) |
729 | if (flags & HeightValue) |
728 | { |
730 | { |
729 | nrow = BOUND_POSITIVE_INT16 (h); |
731 | nrow = clamp (h, 0, std::numeric_limits<int16_t>::max ()); |
730 | szHint.flags |= USSize; |
732 | szHint.flags |= USSize; |
731 | } |
733 | } |
732 | |
734 | |
733 | if (flags & XValue) |
735 | if (flags & XValue) |
734 | { |
736 | { |
… | |
… | |
795 | szHint.width = newwidth; |
797 | szHint.width = newwidth; |
796 | width = newwidth - szHint.base_width; |
798 | width = newwidth - szHint.base_width; |
797 | } |
799 | } |
798 | else |
800 | else |
799 | { |
801 | { |
800 | MIN_IT (width, max_width); |
802 | min_it (width, max_width); |
801 | szHint.width = szHint.base_width + width; |
803 | szHint.width = szHint.base_width + width; |
802 | } |
804 | } |
803 | |
805 | |
804 | if (newheight && newheight - szHint.base_height < max_height) |
806 | if (newheight && newheight - szHint.base_height < max_height) |
805 | { |
807 | { |
806 | szHint.height = newheight; |
808 | szHint.height = newheight; |
807 | height = newheight - szHint.base_height; |
809 | height = newheight - szHint.base_height; |
808 | } |
810 | } |
809 | else |
811 | else |
810 | { |
812 | { |
811 | MIN_IT (height, max_height); |
813 | min_it (height, max_height); |
812 | szHint.height = szHint.base_height + height; |
814 | szHint.height = szHint.base_height + height; |
813 | } |
815 | } |
814 | |
816 | |
815 | if (scrollbar_visible () && (options & Opt_scrollBar_right)) |
817 | if (scrollbar_visible () && (options & Opt_scrollBar_right)) |
816 | window_sb_x = szHint.width - sb_w; |
818 | window_sb_x = szHint.width - sb_w; |
… | |
… | |
889 | prop.height += lineSpace; |
891 | prop.height += lineSpace; |
890 | fs->set_prop (prop); |
892 | fs->set_prop (prop); |
891 | |
893 | |
892 | fwidth = prop.width; |
894 | fwidth = prop.width; |
893 | fheight = prop.height; |
895 | fheight = prop.height; |
894 | fweight = prop.weight; |
|
|
895 | fslant = prop.slant; |
|
|
896 | fbase = (*fs)[1]->ascent; |
896 | fbase = (*fs)[1]->ascent; |
897 | |
897 | |
898 | for (int style = 1; style < 4; style++) |
898 | for (int style = 1; style < 4; style++) |
899 | { |
899 | { |
900 | #if ENABLE_STYLES |
900 | #if ENABLE_STYLES |