… | |
… | |
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 | { |
… | |
… | |
225 | |
225 | |
226 | screen.tscroll = 0; |
226 | screen.tscroll = 0; |
227 | screen.bscroll = nrow - 1; |
227 | screen.bscroll = nrow - 1; |
228 | |
228 | |
229 | void *prev_chunk = chunk; |
229 | void *prev_chunk = chunk; |
|
|
230 | size_t prev_chunk_size = chunk_size; |
230 | line_t *prev_drawn_buf = drawn_buf; |
231 | line_t *prev_drawn_buf = drawn_buf; |
231 | line_t *prev_swap_buf = swap_buf; |
232 | line_t *prev_swap_buf = swap_buf; |
232 | line_t *prev_row_buf = row_buf; |
233 | line_t *prev_row_buf = row_buf; |
233 | |
234 | |
234 | int common_col = min (prev_ncol, ncol); |
235 | int common_col = min (prev_ncol, ncol); |
… | |
… | |
408 | if (!ROW (row).valid ()) scr_blank_screen_mem (ROW (row), DEFAULT_RSTYLE); |
409 | if (!ROW (row).valid ()) scr_blank_screen_mem (ROW (row), DEFAULT_RSTYLE); |
409 | if (!swap_buf [row].valid ()) scr_blank_screen_mem (swap_buf [row], DEFAULT_RSTYLE); |
410 | if (!swap_buf [row].valid ()) scr_blank_screen_mem (swap_buf [row], DEFAULT_RSTYLE); |
410 | if (!drawn_buf [row].valid ()) scr_blank_screen_mem (drawn_buf [row], DEFAULT_RSTYLE); |
411 | if (!drawn_buf [row].valid ()) scr_blank_screen_mem (drawn_buf [row], DEFAULT_RSTYLE); |
411 | } |
412 | } |
412 | |
413 | |
413 | free (prev_chunk); |
414 | chunk_free (prev_chunk, prev_chunk_size); |
414 | |
415 | |
415 | free (tabs); |
416 | free (tabs); |
416 | tabs = (char *)rxvt_malloc (ncol); |
417 | tabs = (char *)rxvt_malloc (ncol); |
417 | |
418 | |
418 | for (int col = ncol; col--; ) |
419 | for (int col = ncol; col--; ) |
… | |
… | |
429 | } |
430 | } |
430 | |
431 | |
431 | void ecb_cold |
432 | void ecb_cold |
432 | rxvt_term::scr_release () NOTHROW |
433 | rxvt_term::scr_release () NOTHROW |
433 | { |
434 | { |
434 | free (chunk); chunk = 0; row_buf = 0; |
435 | chunk_free (chunk, chunk_size); |
435 | free (tabs); tabs = 0; |
436 | chunk = 0; |
|
|
437 | row_buf = 0; |
|
|
438 | |
|
|
439 | free (tabs); |
|
|
440 | tabs = 0; |
436 | } |
441 | } |
437 | |
442 | |
438 | /* ------------------------------------------------------------------------- */ |
443 | /* ------------------------------------------------------------------------- */ |
439 | /* |
444 | /* |
440 | * Hard/Soft reset |
445 | * Hard/Soft reset |
… | |
… | |
1702 | { |
1707 | { |
1703 | rvideo_state = on; |
1708 | rvideo_state = on; |
1704 | |
1709 | |
1705 | ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); |
1710 | ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); |
1706 | #ifdef HAVE_BG_PIXMAP |
1711 | #ifdef HAVE_BG_PIXMAP |
1707 | if (bg_pixmap == None) |
1712 | if (bg_img == 0) |
1708 | #endif |
1713 | #endif |
1709 | XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); |
1714 | XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); |
1710 | |
1715 | |
1711 | XGCValues gcvalue; |
1716 | XGCValues gcvalue; |
1712 | gcvalue.foreground = pix_colors[Color_fg]; |
1717 | gcvalue.foreground = pix_colors[Color_fg]; |
… | |
… | |
2047 | refresh_count = 0; |
2052 | refresh_count = 0; |
2048 | |
2053 | |
2049 | unsigned int old_screen_flags = screen.flags; |
2054 | unsigned int old_screen_flags = screen.flags; |
2050 | bool have_bg = 0; |
2055 | bool have_bg = 0; |
2051 | #ifdef HAVE_BG_PIXMAP |
2056 | #ifdef HAVE_BG_PIXMAP |
2052 | have_bg = bg_pixmap != None; |
2057 | have_bg = bg_img != 0; |
2053 | #endif |
2058 | #endif |
2054 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2059 | ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ |
2055 | |
2060 | |
2056 | /* |
2061 | /* |
2057 | * B: reverse any characters which are selected |
2062 | * B: reverse any characters which are selected |
… | |
… | |
2528 | rxvt_term::scr_recolour (bool refresh) NOTHROW |
2533 | rxvt_term::scr_recolour (bool refresh) NOTHROW |
2529 | { |
2534 | { |
2530 | bool transparent = false; |
2535 | bool transparent = false; |
2531 | |
2536 | |
2532 | #ifdef HAVE_BG_PIXMAP |
2537 | #ifdef HAVE_BG_PIXMAP |
2533 | if (bg_pixmap != None) |
2538 | if (bg_img != 0) |
2534 | { |
2539 | { |
2535 | # ifdef ENABLE_TRANSPARENCY |
2540 | # if ENABLE_TRANSPARENCY |
2536 | if (bg_flags & BG_IS_TRANSPARENT) |
2541 | if (bg_flags & BG_IS_TRANSPARENT) |
2537 | { |
2542 | { |
2538 | XSetWindowBackgroundPixmap (dpy, parent, bg_pixmap); |
2543 | XSetWindowBackgroundPixmap (dpy, parent, bg_img->pm); |
2539 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
2544 | XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); |
2540 | |
2545 | |
2541 | transparent = true; |
2546 | transparent = true; |
2542 | } |
2547 | } |
2543 | else |
2548 | else |
2544 | # endif |
2549 | # endif |
2545 | { |
2550 | { |
2546 | XSetWindowBackground (dpy, parent, pix_colors[Color_border]); |
2551 | XSetWindowBackground (dpy, parent, pix_colors[Color_border]); |
2547 | XSetWindowBackgroundPixmap (dpy, vt, bg_pixmap); |
2552 | XSetWindowBackgroundPixmap (dpy, vt, bg_img->pm); |
2548 | } |
2553 | } |
2549 | } |
2554 | } |
2550 | else |
2555 | else |
2551 | #endif |
2556 | #endif |
2552 | { |
2557 | { |
… | |
… | |
2559 | if (scrollBar.win) |
2564 | if (scrollBar.win) |
2560 | { |
2565 | { |
2561 | if (transparent) |
2566 | if (transparent) |
2562 | XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); |
2567 | XSetWindowBackgroundPixmap (dpy, scrollBar.win, ParentRelative); |
2563 | else |
2568 | else |
2564 | XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); |
2569 | XSetWindowBackground (dpy, scrollBar.win, pix_colors[scrollBar.color ()]); |
2565 | scrollBar.state = SB_STATE_IDLE; |
2570 | scrollBar.state = SB_STATE_IDLE; |
2566 | scrollBar.show (0); |
2571 | scrollBar.show (0); |
2567 | } |
2572 | } |
2568 | |
2573 | |
2569 | if (refresh) |
2574 | if (refresh) |
… | |
… | |
3526 | |
3531 | |
3527 | XSendEvent (dpy, rq.requestor, False, 0L, (XEvent *)&ev); |
3532 | XSendEvent (dpy, rq.requestor, False, 0L, (XEvent *)&ev); |
3528 | } |
3533 | } |
3529 | |
3534 | |
3530 | /* ------------------------------------------------------------------------- */ |
3535 | /* ------------------------------------------------------------------------- */ |
3531 | #ifdef USE_XIM |
3536 | #if USE_XIM |
3532 | void ecb_cold |
3537 | void ecb_cold |
3533 | rxvt_term::im_set_position (XPoint &pos) NOTHROW |
3538 | rxvt_term::im_set_position (XPoint &pos) NOTHROW |
3534 | { |
3539 | { |
3535 | XWindowAttributes xwa; |
3540 | XWindowAttributes xwa; |
3536 | |
3541 | |