… | |
… | |
30 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
30 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
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 | #include "main.intpro" /* PROTOS for internal routines */ |
|
|
36 | |
35 | |
37 | #include <csignal> |
36 | #include <csignal> |
38 | #include <cstring> |
37 | #include <cstring> |
39 | |
38 | |
40 | #ifdef TTY_GID_SUPPORT |
39 | #ifdef TTY_GID_SUPPORT |
… | |
… | |
586 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
585 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
587 | |
586 | |
588 | return p; |
587 | return p; |
589 | } |
588 | } |
590 | |
589 | |
591 | /* INTPROTO */ |
|
|
592 | void * |
590 | void * |
593 | rxvt_calloc (size_t number, size_t size) |
591 | rxvt_calloc (size_t number, size_t size) |
594 | { |
592 | { |
595 | void *p = calloc (number, size); |
593 | void *p = calloc (number, size); |
596 | |
594 | |
… | |
… | |
598 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
596 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
599 | |
597 | |
600 | return p; |
598 | return p; |
601 | } |
599 | } |
602 | |
600 | |
603 | /* INTPROTO */ |
|
|
604 | void * |
601 | void * |
605 | rxvt_realloc (void *ptr, size_t size) |
602 | rxvt_realloc (void *ptr, size_t size) |
606 | { |
603 | { |
607 | void *p = realloc (ptr, size); |
604 | void *p = realloc (ptr, size); |
608 | |
605 | |
… | |
… | |
712 | if (!parsed_geometry) |
709 | if (!parsed_geometry) |
713 | { |
710 | { |
714 | parsed_geometry = 1; |
711 | parsed_geometry = 1; |
715 | if (rs[Rs_geometry]) |
712 | if (rs[Rs_geometry]) |
716 | flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); |
713 | flags = XParseGeometry (rs[Rs_geometry], &x, &y, &w, &h); |
|
|
714 | |
717 | if (flags & WidthValue) |
715 | if (flags & WidthValue) |
718 | { |
716 | { |
719 | TermWin.ncol = BOUND_POSITIVE_INT16 (w); |
717 | TermWin.ncol = BOUND_POSITIVE_INT16 (w); |
720 | szHint.flags |= USSize; |
718 | szHint.flags |= USSize; |
721 | } |
719 | } |
|
|
720 | |
722 | if (flags & HeightValue) |
721 | if (flags & HeightValue) |
723 | { |
722 | { |
724 | TermWin.nrow = BOUND_POSITIVE_INT16 (h); |
723 | TermWin.nrow = BOUND_POSITIVE_INT16 (h); |
725 | szHint.flags |= USSize; |
724 | szHint.flags |= USSize; |
726 | } |
725 | } |
|
|
726 | |
727 | if (flags & XValue) |
727 | if (flags & XValue) |
728 | { |
728 | { |
729 | szHint.x = x; |
729 | szHint.x = x; |
730 | szHint.flags |= USPosition; |
730 | szHint.flags |= USPosition; |
731 | if (flags & XNegative) |
731 | if (flags & XNegative) |
732 | { |
732 | { |
733 | recalc_x = 1; |
733 | recalc_x = 1; |
734 | szHint.win_gravity = NorthEastGravity; |
734 | szHint.win_gravity = NorthEastGravity; |
735 | } |
735 | } |
736 | } |
736 | } |
|
|
737 | |
737 | if (flags & YValue) |
738 | if (flags & YValue) |
738 | { |
739 | { |
739 | szHint.y = y; |
740 | szHint.y = y; |
740 | szHint.flags |= USPosition; |
741 | szHint.flags |= USPosition; |
741 | if (flags & YNegative) |
742 | if (flags & YNegative) |
… | |
… | |
840 | (void)ioctl (pty.pty, TIOCSWINSZ, &ws); |
841 | (void)ioctl (pty.pty, TIOCSWINSZ, &ws); |
841 | |
842 | |
842 | #if 0 |
843 | #if 0 |
843 | // TIOCSWINSZ⎈ is supposed to do this automatically and correctly |
844 | // TIOCSWINSZ⎈ is supposed to do this automatically and correctly |
844 | if (cmd_pid) /* force through to the command */ |
845 | if (cmd_pid) /* force through to the command */ |
845 | kill (cmd_pid, SIGWINCH); |
846 | kill (-cmd_pid, SIGWINCH); |
846 | #endif |
847 | #endif |
847 | } |
848 | } |
848 | |
849 | |
849 | /*----------------------------------------------------------------------*/ |
850 | /*----------------------------------------------------------------------*/ |
850 | /* set_fonts () - load and set the various fonts |
851 | /* set_fonts () - load and set the various fonts |
… | |
… | |
954 | /* xterm sequences - title, iconName, color (exptl) */ |
955 | /* xterm sequences - title, iconName, color (exptl) */ |
955 | void |
956 | void |
956 | rxvt_term::set_title (const char *str) |
957 | rxvt_term::set_title (const char *str) |
957 | { |
958 | { |
958 | set_string_property (XA_WM_NAME, str); |
959 | set_string_property (XA_WM_NAME, str); |
959 | #if ENABLE_FRILLS |
960 | #if ENABLE_EWMH |
960 | set_utf8_property (xa[XA_NET_WM_NAME], str); |
961 | set_utf8_property (xa[XA_NET_WM_NAME], str); |
961 | #endif |
962 | #endif |
962 | } |
963 | } |
963 | |
964 | |
964 | void |
965 | void |
965 | rxvt_term::set_icon_name (const char *str) |
966 | rxvt_term::set_icon_name (const char *str) |
966 | { |
967 | { |
967 | set_string_property (XA_WM_ICON_NAME, str); |
968 | set_string_property (XA_WM_ICON_NAME, str); |
968 | #if ENABLE_FRILLS |
969 | #if ENABLE_EWMH |
969 | set_utf8_property (xa[XA_NET_WM_ICON_NAME], str); |
970 | set_utf8_property (xa[XA_NET_WM_ICON_NAME], str); |
970 | #endif |
971 | #endif |
971 | } |
972 | } |
972 | |
973 | |
973 | #ifdef XTERM_COLOR_CHANGE |
974 | #ifdef XTERM_COLOR_CHANGE |
… | |
… | |
1245 | XWindowAttributes wattr; |
1246 | XWindowAttributes wattr; |
1246 | |
1247 | |
1247 | if (width == 0 || height == 0) |
1248 | if (width == 0 || height == 0) |
1248 | { |
1249 | { |
1249 | XGetWindowAttributes (display->display, display->root, &wattr); |
1250 | XGetWindowAttributes (display->display, display->root, &wattr); |
|
|
1251 | |
1250 | if (width == 0) |
1252 | if (width == 0) |
1251 | width = wattr.width - szHint.base_width; |
1253 | width = wattr.width - szHint.base_width; |
1252 | if (height == 0) |
1254 | if (height == 0) |
1253 | height = wattr.height - szHint.base_height; |
1255 | height = wattr.height - szHint.base_height; |
1254 | } |
1256 | } |