… | |
… | |
252 | //if (menuBar.win) |
252 | //if (menuBar.win) |
253 | // XDestroyWindow (disp, menuBar.win); |
253 | // XDestroyWindow (disp, menuBar.win); |
254 | #endif |
254 | #endif |
255 | delete TermWin.drawable; |
255 | delete TermWin.drawable; |
256 | // destroy all windows |
256 | // destroy all windows |
257 | if (TermWin.parent[0] |
257 | if (TermWin.parent[0]) |
258 | #if ENABLE_FRILLS |
|
|
259 | && !rs[Rs_embed] |
|
|
260 | #endif |
|
|
261 | ) |
|
|
262 | XDestroyWindow (disp, TermWin.parent[0]); |
258 | XDestroyWindow (disp, TermWin.parent[0]); |
263 | } |
259 | } |
264 | |
260 | |
265 | // TODO: free pixcolours, colours should become part of rxvt_display |
261 | // TODO: free pixcolours, colours should become part of rxvt_display |
266 | |
262 | |
267 | delete pix_colors_focused; |
263 | delete pix_colors_focused; |
268 | #ifdef OFF_FOCUS_FADING |
264 | #if OFF_FOCUS_FADING |
269 | delete pix_colors_unfocused; |
265 | delete pix_colors_unfocused; |
270 | #endif |
266 | #endif |
271 | |
267 | |
272 | displays.put (display); |
268 | displays.put (display); |
273 | |
269 | |
… | |
… | |
421 | { |
417 | { |
422 | if (GET_R->allowedxerror == -1) |
418 | if (GET_R->allowedxerror == -1) |
423 | GET_R->allowedxerror = event->error_code; |
419 | GET_R->allowedxerror = event->error_code; |
424 | else |
420 | else |
425 | { |
421 | { |
426 | //TODO: GET_R is most likely not the terminal which caused the error |
422 | // GET_R is most likely not the terminal which caused the error, |
427 | //TODO: maybe just output the error and continue? |
423 | // so just output the error and continue |
428 | #if ENABLE_FRILLS |
424 | #if ENABLE_FRILLS |
429 | print_x_error (display, event); |
425 | print_x_error (display, event); |
430 | #else |
426 | #else |
431 | old_xerror_handler (display, event); |
427 | old_xerror_handler (display, event); |
432 | #endif |
428 | #endif |
… | |
… | |
589 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
585 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
590 | |
586 | |
591 | return p; |
587 | return p; |
592 | } |
588 | } |
593 | |
589 | |
594 | /* INTPROTO */ |
|
|
595 | void * |
590 | void * |
596 | rxvt_calloc (size_t number, size_t size) |
591 | rxvt_calloc (size_t number, size_t size) |
597 | { |
592 | { |
598 | void *p = calloc (number, size); |
593 | void *p = calloc (number, size); |
599 | |
594 | |
… | |
… | |
601 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
596 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
602 | |
597 | |
603 | return p; |
598 | return p; |
604 | } |
599 | } |
605 | |
600 | |
606 | /* INTPROTO */ |
|
|
607 | void * |
601 | void * |
608 | rxvt_realloc (void *ptr, size_t size) |
602 | rxvt_realloc (void *ptr, size_t size) |
609 | { |
603 | { |
610 | void *p = realloc (ptr, size); |
604 | void *p = realloc (ptr, size); |
611 | |
605 | |
… | |
… | |
847 | (void)ioctl (pty.pty, TIOCSWINSZ, &ws); |
841 | (void)ioctl (pty.pty, TIOCSWINSZ, &ws); |
848 | |
842 | |
849 | #if 0 |
843 | #if 0 |
850 | // TIOCSWINSZ⎈ is supposed to do this automatically and correctly |
844 | // TIOCSWINSZ⎈ is supposed to do this automatically and correctly |
851 | if (cmd_pid) /* force through to the command */ |
845 | if (cmd_pid) /* force through to the command */ |
852 | kill (cmd_pid, SIGWINCH); |
846 | kill (-cmd_pid, SIGWINCH); |
853 | #endif |
847 | #endif |
854 | } |
848 | } |
855 | |
849 | |
856 | /*----------------------------------------------------------------------*/ |
850 | /*----------------------------------------------------------------------*/ |
857 | /* set_fonts () - load and set the various fonts |
851 | /* set_fonts () - load and set the various fonts |
858 | /* |
852 | * |
859 | * init = 1 - initialize |
853 | * init = 1 - initialize |
860 | * |
854 | * |
861 | * fontname == FONT_UP - switch to bigger font |
855 | * fontname == FONT_UP - switch to bigger font |
862 | * fontname == FONT_DN - switch to smaller font |
856 | * fontname == FONT_DN - switch to smaller font |
863 | */ |
857 | */ |
… | |
… | |
961 | /* xterm sequences - title, iconName, color (exptl) */ |
955 | /* xterm sequences - title, iconName, color (exptl) */ |
962 | void |
956 | void |
963 | rxvt_term::set_title (const char *str) |
957 | rxvt_term::set_title (const char *str) |
964 | { |
958 | { |
965 | set_string_property (XA_WM_NAME, str); |
959 | set_string_property (XA_WM_NAME, str); |
966 | #if ENABLE_FRILLS |
960 | #if ENABLE_EWMH |
967 | set_utf8_property (xa[XA_NET_WM_NAME], str); |
961 | set_utf8_property (xa[XA_NET_WM_NAME], str); |
968 | #endif |
962 | #endif |
969 | } |
963 | } |
970 | |
964 | |
971 | void |
965 | void |
972 | rxvt_term::set_icon_name (const char *str) |
966 | rxvt_term::set_icon_name (const char *str) |
973 | { |
967 | { |
974 | set_string_property (XA_WM_ICON_NAME, str); |
968 | set_string_property (XA_WM_ICON_NAME, str); |
975 | #if ENABLE_FRILLS |
969 | #if ENABLE_EWMH |
976 | set_utf8_property (xa[XA_NET_WM_ICON_NAME], str); |
970 | set_utf8_property (xa[XA_NET_WM_ICON_NAME], str); |
977 | #endif |
971 | #endif |
978 | } |
972 | } |
979 | |
973 | |
980 | #ifdef XTERM_COLOR_CHANGE |
974 | #ifdef XTERM_COLOR_CHANGE |
… | |
… | |
996 | { /* bright colors */ |
990 | { /* bright colors */ |
997 | i -= 8; |
991 | i -= 8; |
998 | # ifndef NO_BRIGHTCOLOR |
992 | # ifndef NO_BRIGHTCOLOR |
999 | pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; |
993 | pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i]; |
1000 | SET_PIXCOLOR (idx); |
994 | SET_PIXCOLOR (idx); |
1001 | goto Done; |
995 | goto done; |
1002 | # endif |
996 | # endif |
1003 | } |
997 | } |
1004 | |
998 | |
1005 | if (i >= 0 && i <= 7) |
999 | if (i >= 0 && i <= 7) |
1006 | { /* normal colors */ |
1000 | { /* normal colors */ |
1007 | pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; |
1001 | pix_colors_focused[idx] = pix_colors_focused[minCOLOR + i]; |
1008 | SET_PIXCOLOR (idx); |
1002 | SET_PIXCOLOR (idx); |
1009 | goto Done; |
1003 | goto done; |
1010 | } |
1004 | } |
1011 | } |
1005 | } |
1012 | |
1006 | |
1013 | if (!rXParseAllocColor (&xcol, color)) |
1007 | if (!rXParseAllocColor (&xcol, color)) |
1014 | return; |
1008 | return; |
… | |
… | |
1034 | pix_colors_focused[idx] = xcol; |
1028 | pix_colors_focused[idx] = xcol; |
1035 | SET_PIXCOLOR (idx); |
1029 | SET_PIXCOLOR (idx); |
1036 | |
1030 | |
1037 | /* XSetWindowAttributes attr; */ |
1031 | /* XSetWindowAttributes attr; */ |
1038 | /* Cursor cursor; */ |
1032 | /* Cursor cursor; */ |
1039 | Done: |
1033 | done: |
|
|
1034 | |
1040 | #ifdef OFF_FOCUS_FADING |
1035 | #if OFF_FOCUS_FADING |
1041 | if (rs[Rs_fade]) |
1036 | if (rs[Rs_fade]) |
1042 | pix_colors_unfocused[idx] = pix_colors_focused[idx].fade (display, atoi (rs[Rs_fade])); |
1037 | pix_colors_unfocused[idx] = pix_colors_focused[idx].fade (display, atoi (rs[Rs_fade]), pix_colors[Color_fade]); |
1043 | #endif |
1038 | #endif |
1044 | |
1039 | |
1045 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
1040 | /*TODO: handle Color_BD, scrollbar background, etc. */ |
1046 | |
1041 | |
1047 | recolour_cursor (); |
1042 | recolour_cursor (); |
… | |
… | |
1252 | XWindowAttributes wattr; |
1247 | XWindowAttributes wattr; |
1253 | |
1248 | |
1254 | if (width == 0 || height == 0) |
1249 | if (width == 0 || height == 0) |
1255 | { |
1250 | { |
1256 | XGetWindowAttributes (display->display, display->root, &wattr); |
1251 | XGetWindowAttributes (display->display, display->root, &wattr); |
|
|
1252 | |
1257 | if (width == 0) |
1253 | if (width == 0) |
1258 | width = wattr.width - szHint.base_width; |
1254 | width = wattr.width - szHint.base_width; |
1259 | if (height == 0) |
1255 | if (height == 0) |
1260 | height = wattr.height - szHint.base_height; |
1256 | height = wattr.height - szHint.base_height; |
1261 | } |
1257 | } |
… | |
… | |
1555 | } |
1551 | } |
1556 | |
1552 | |
1557 | void |
1553 | void |
1558 | rxvt_term::im_cb () |
1554 | rxvt_term::im_cb () |
1559 | { |
1555 | { |
1560 | int i, found, had_im; |
1556 | int i; |
1561 | const char *p; |
1557 | const char *p; |
1562 | char **s; |
1558 | char **s; |
1563 | char buf[IMBUFSIZ]; |
1559 | char buf[IMBUFSIZ]; |
1564 | |
1560 | |
1565 | SET_R (this); |
1561 | SET_R (this); |