… | |
… | |
169 | tsize -= tsize % sizeof (rend_t); |
169 | tsize -= tsize % sizeof (rend_t); |
170 | |
170 | |
171 | int all_rows = total_rows + nrow + nrow; |
171 | int all_rows = total_rows + nrow + nrow; |
172 | |
172 | |
173 | chunk_size = (sizeof (line_t) + rsize + tsize) * all_rows; |
173 | chunk_size = (sizeof (line_t) + rsize + tsize) * all_rows; |
174 | chunk = rxvt_malloc (chunk_size); |
174 | chunk = chunk_alloc (chunk_size, 0); |
175 | |
175 | |
176 | char *base = (char *)chunk + sizeof (line_t) * all_rows; |
176 | char *base = (char *)chunk + sizeof (line_t) * all_rows; |
177 | |
177 | |
178 | for (int row = 0; row < all_rows; ++row) |
178 | for (int row = 0; row < all_rows; ++row) |
179 | { |
179 | { |
… | |
… | |
236 | scr_alloc (); |
236 | scr_alloc (); |
237 | |
237 | |
238 | if (!prev_row_buf) |
238 | if (!prev_row_buf) |
239 | { |
239 | { |
240 | /* |
240 | /* |
241 | * first time called so just malloc everything: don't rely on realloc |
241 | * first time called (or after scr_release) so just malloc everything: don't rely on realloc |
242 | */ |
242 | */ |
243 | top_row = 0; |
243 | top_row = 0; |
244 | term_start = 0; |
244 | term_start = 0; |
245 | |
245 | |
246 | memset (charsets, 'B', sizeof (charsets)); |
246 | memset (charsets, 'B', sizeof (charsets)); |
… | |
… | |
426 | tt_winch (); |
426 | tt_winch (); |
427 | |
427 | |
428 | HOOK_INVOKE ((this, HOOK_RESET, DT_END)); |
428 | HOOK_INVOKE ((this, HOOK_RESET, DT_END)); |
429 | } |
429 | } |
430 | |
430 | |
431 | /* ------------------------------------------------------------------------- */ |
|
|
432 | /* |
|
|
433 | * Free everything. That way malloc debugging can find leakage. |
|
|
434 | */ |
|
|
435 | void ecb_cold |
431 | void ecb_cold |
436 | rxvt_term::scr_release () NOTHROW |
432 | rxvt_term::scr_release () NOTHROW |
437 | { |
433 | { |
438 | free (chunk); |
434 | chunk_free (chunk, chunk_size); |
|
|
435 | chunk = 0; |
|
|
436 | row_buf = 0; |
|
|
437 | |
439 | free (tabs); |
438 | free (tabs); |
|
|
439 | tabs = 0; |
440 | } |
440 | } |
441 | |
441 | |
442 | /* ------------------------------------------------------------------------- */ |
442 | /* ------------------------------------------------------------------------- */ |
443 | /* |
443 | /* |
444 | * Hard/Soft reset |
444 | * Hard/Soft reset |
… | |
… | |
446 | void ecb_cold |
446 | void ecb_cold |
447 | rxvt_term::scr_poweron () |
447 | rxvt_term::scr_poweron () |
448 | { |
448 | { |
449 | scr_release (); |
449 | scr_release (); |
450 | |
450 | |
451 | row_buf = 0; |
|
|
452 | tabs = 0; |
|
|
453 | prev_nrow = prev_ncol = 0; |
451 | prev_nrow = prev_ncol = 0; |
454 | rvideo_mode = false; |
452 | rvideo_mode = false; |
455 | scr_soft_reset (); |
453 | scr_soft_reset (); |
456 | scr_reset (); |
454 | scr_reset (); |
457 | |
455 | |
… | |
… | |
1708 | { |
1706 | { |
1709 | rvideo_state = on; |
1707 | rvideo_state = on; |
1710 | |
1708 | |
1711 | ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); |
1709 | ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); |
1712 | #ifdef HAVE_BG_PIXMAP |
1710 | #ifdef HAVE_BG_PIXMAP |
1713 | if (bg_pixmap == None) |
1711 | if (bg_img == 0) |
1714 | #endif |
1712 | #endif |
1715 | XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); |
1713 | XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); |
1716 | |
1714 | |
1717 | XGCValues gcvalue; |
1715 | XGCValues gcvalue; |
1718 | gcvalue.foreground = pix_colors[Color_fg]; |
1716 | gcvalue.foreground = pix_colors[Color_fg]; |
… | |
… | |
2053 | refresh_count = 0; |
2051 | refresh_count = 0; |
2054 | |
2052 | |
2055 | unsigned int old_screen_flags = screen.flags; |
2053 | unsigned int old_screen_flags = screen.flags; |
2056 | bool have_bg = 0; |
2054 | bool have_bg = 0; |
2057 | #ifdef HAVE_BG_PIXMAP |
2055 | #ifdef HAVE_BG_PIXMAP |
2058 | have_bg = bg_pixmap != None; |
2056 | have_bg = bg_img != 0; |
2059 | #endif |
2057 | #endif |
2060 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2058 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2061 | |
2059 | |
2062 | /* |
2060 | /* |
2063 | * B: reverse any characters which are selected |
2061 | * B: reverse any characters which are selected |
… | |
… | |
2534 | rxvt_term::scr_recolour (bool refresh) NOTHROW |
2532 | rxvt_term::scr_recolour (bool refresh) NOTHROW |
2535 | { |
2533 | { |
2536 | bool transparent = false; |
2534 | bool transparent = false; |
2537 | |
2535 | |
2538 | #ifdef HAVE_BG_PIXMAP |
2536 | #ifdef HAVE_BG_PIXMAP |
2539 | if (bg_pixmap != None) |
2537 | if (bg_img != 0) |
2540 | { |
2538 | { |
2541 | # ifdef ENABLE_TRANSPARENCY |
2539 | # if ENABLE_TRANSPARENCY |
2542 | if (bg_flags & BG_IS_TRANSPARENT) |
2540 | if (bg_flags & BG_IS_TRANSPARENT) |
2543 | { |
2541 | { |
2544 | XSetWindowBackgroundPixmap (dpy, parent, bg_pixmap); |
2542 | XSetWindowBackgroundPixmap (dpy, parent, bg_img->pm); |
2545 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
2543 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
2546 | |
2544 | |
2547 | transparent = true; |
2545 | transparent = true; |
2548 | } |
2546 | } |
2549 | else |
2547 | else |
2550 | # endif |
2548 | # endif |
2551 | { |
2549 | { |
2552 | XSetWindowBackground (dpy, parent, pix_colors[Color_border]); |
2550 | XSetWindowBackground (dpy, parent, pix_colors[Color_border]); |
2553 | XSetWindowBackgroundPixmap (dpy, vt, bg_pixmap); |
2551 | XSetWindowBackgroundPixmap (dpy, vt, bg_img->pm); |
2554 | } |
2552 | } |
2555 | } |
2553 | } |
2556 | else |
2554 | else |
2557 | #endif |
2555 | #endif |
2558 | { |
2556 | { |
… | |
… | |
3532 | |
3530 | |
3533 | XSendEvent (dpy, rq.requestor, False, 0L, (XEvent *)&ev); |
3531 | XSendEvent (dpy, rq.requestor, False, 0L, (XEvent *)&ev); |
3534 | } |
3532 | } |
3535 | |
3533 | |
3536 | /* ------------------------------------------------------------------------- */ |
3534 | /* ------------------------------------------------------------------------- */ |
3537 | #ifdef USE_XIM |
3535 | #if USE_XIM |
3538 | void ecb_cold |
3536 | void ecb_cold |
3539 | rxvt_term::im_set_position (XPoint &pos) NOTHROW |
3537 | rxvt_term::im_set_position (XPoint &pos) NOTHROW |
3540 | { |
3538 | { |
3541 | XWindowAttributes xwa; |
3539 | XWindowAttributes xwa; |
3542 | |
3540 | |