… | |
… | |
294 | ralloc->free (drawn_rend[p]); |
294 | ralloc->free (drawn_rend[p]); |
295 | } |
295 | } |
296 | |
296 | |
297 | /* we have fewer rows so fix up cursor position */ |
297 | /* we have fewer rows so fix up cursor position */ |
298 | MIN_IT (screen.cur.row, (int32_t)nrow - 1); |
298 | MIN_IT (screen.cur.row, (int32_t)nrow - 1); |
299 | MIN_IT (swap.cur.row, (int32_t)nrow - 1); |
|
|
300 | |
299 | |
301 | scr_reset_realloc (); /* realloc _last_ */ |
300 | scr_reset_realloc (); /* realloc _last_ */ |
302 | } |
301 | } |
303 | else if (nrow > prev_nrow) |
302 | else if (nrow > prev_nrow) |
304 | { |
303 | { |
… | |
… | |
337 | screen.s_cur.row += k; |
336 | screen.s_cur.row += k; |
338 | TermWin.nscrolled -= k; |
337 | TermWin.nscrolled -= k; |
339 | } |
338 | } |
340 | #ifdef DEBUG_STRICT |
339 | #ifdef DEBUG_STRICT |
341 | assert (screen.cur.row < TermWin.nrow); |
340 | assert (screen.cur.row < TermWin.nrow); |
342 | assert (swap.cur.row < TermWin.nrow); |
|
|
343 | #else /* drive with your eyes closed */ |
341 | #else /* drive with your eyes closed */ |
344 | |
342 | |
345 | MIN_IT (screen.cur.row, nrow - 1); |
343 | MIN_IT (screen.cur.row, nrow - 1); |
346 | MIN_IT (swap.cur.row, nrow - 1); |
|
|
347 | #endif |
344 | #endif |
348 | TermWin.ncol = ncol; // save b/c scr_blank_screen_mem uses this |
345 | TermWin.ncol = ncol; // save b/c scr_blank_screen_mem uses this |
349 | } |
346 | } |
350 | |
347 | |
351 | /* resize columns */ |
348 | /* resize columns */ |
… | |
… | |
394 | } |
391 | } |
395 | |
392 | |
396 | } |
393 | } |
397 | |
394 | |
398 | MIN_IT (screen.cur.col, (int16_t)ncol - 1); |
395 | MIN_IT (screen.cur.col, (int16_t)ncol - 1); |
399 | MIN_IT (swap.cur.col, (int16_t)ncol - 1); |
|
|
400 | |
396 | |
401 | delete talloc; talloc = ta; |
397 | delete talloc; talloc = ta; |
402 | delete ralloc; ralloc = ra; |
398 | delete ralloc; ralloc = ra; |
403 | } |
399 | } |
404 | |
400 | |
… | |
… | |
566 | if (current_screen == scrn) |
562 | if (current_screen == scrn) |
567 | return scrn; |
563 | return scrn; |
568 | |
564 | |
569 | selection_check (2); /* check for boundary cross */ |
565 | selection_check (2); /* check for boundary cross */ |
570 | |
566 | |
571 | SWAP_IT (current_screen, scrn, int); |
567 | i = current_screen; current_screen = scrn; scrn = i; |
572 | |
568 | |
573 | SWAP_IT (screen.cur.row, swap.cur.row, int16_t); |
569 | SWAP_IT (screen.cur.row, swap.cur.row, int16_t); |
574 | SWAP_IT (screen.cur.col, swap.cur.col, int16_t); |
570 | SWAP_IT (screen.cur.col, swap.cur.col, int16_t); |
575 | # ifdef DEBUG_STRICT |
|
|
576 | assert (screen.cur.row >= 0 && screen.cur.row < prev_nrow); |
|
|
577 | assert (screen.cur.col >= 0 && screen.cur.col < prev_ncol); |
|
|
578 | # else /* drive with your eyes closed */ |
|
|
579 | MAX_IT (screen.cur.row, 0); |
571 | MAX_IT (screen.cur.row, 0); |
580 | MIN_IT (screen.cur.row, (int32_t)prev_nrow - 1); |
572 | MIN_IT (screen.cur.row, (int32_t)prev_nrow - 1); |
581 | MAX_IT (screen.cur.col, 0); |
573 | MAX_IT (screen.cur.col, 0); |
582 | MIN_IT (screen.cur.col, (int32_t)prev_ncol - 1); |
574 | MIN_IT (screen.cur.col, (int32_t)prev_ncol - 1); |
583 | # endif |
|
|
584 | |
575 | |
585 | #if NSCREENS |
576 | #if NSCREENS |
586 | if (options & Opt_secondaryScreen) |
577 | if (options & Opt_secondaryScreen) |
587 | { |
578 | { |
588 | num_scr = 0; |
579 | num_scr = 0; |
… | |
… | |
2400 | else |
2391 | else |
2401 | font->draw (*TermWin.drawable, xpixel, ypixel, text, count, fore, back); |
2392 | font->draw (*TermWin.drawable, xpixel, ypixel, text, count, fore, back); |
2402 | |
2393 | |
2403 | if (rend & RS_Uline && font->descent > 1 && fore != back) |
2394 | if (rend & RS_Uline && font->descent > 1 && fore != back) |
2404 | { |
2395 | { |
|
|
2396 | #if ENABLE_FRILLS |
|
|
2397 | if (ISSET_PIXCOLOR (Color_underline)) |
|
|
2398 | XSetForeground (display->display, TermWin.gc, pix_colors[Color_underline]); |
|
|
2399 | else |
|
|
2400 | #endif |
2405 | XSetForeground (display->display, TermWin.gc, pix_colors[fore]); |
2401 | XSetForeground (display->display, TermWin.gc, pix_colors[fore]); |
|
|
2402 | |
2406 | XDrawLine (display->display, drawBuffer, TermWin.gc, |
2403 | XDrawLine (display->display, drawBuffer, TermWin.gc, |
2407 | xpixel, ypixel + font->ascent + 1, |
2404 | xpixel, ypixel + font->ascent + 1, |
2408 | xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1); |
2405 | xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1); |
2409 | } |
2406 | } |
2410 | } /* for (col....) */ |
2407 | } /* for (col....) */ |
… | |
… | |
2656 | /* ------------------------------------------------------------------------- */ |
2653 | /* ------------------------------------------------------------------------- */ |
2657 | /* |
2654 | /* |
2658 | * Paste a selection direct to the command fd |
2655 | * Paste a selection direct to the command fd |
2659 | */ |
2656 | */ |
2660 | void |
2657 | void |
2661 | rxvt_term::paste (const unsigned char *data, unsigned int len) |
2658 | rxvt_term::paste (unsigned char *data, unsigned int len) |
2662 | { |
2659 | { |
2663 | unsigned int i, j, n; |
|
|
2664 | unsigned char *ds = (unsigned char *)rxvt_malloc (PASTE_SIZE); |
|
|
2665 | |
|
|
2666 | /* convert normal newline chars into common keyboard Return key sequence */ |
2660 | /* convert normal newline chars into common keyboard Return key sequence */ |
2667 | for (i = 0; i < len; i += PASTE_SIZE) |
2661 | for (unsigned int i = 0; i < len; i++) |
2668 | { |
|
|
2669 | n = min (len - i, PASTE_SIZE); |
|
|
2670 | memcpy (ds, data + i, n); |
|
|
2671 | |
|
|
2672 | for (j = 0; j < n; j++) |
|
|
2673 | if (ds[j] == C0_LF) |
2662 | if (data[i] == C0_LF) |
2674 | ds[j] = C0_CR; |
2663 | data[i] = C0_CR; |
2675 | |
2664 | |
2676 | tt_write (ds, (int)n); |
2665 | tt_write (data, len); |
2677 | } |
|
|
2678 | |
|
|
2679 | free (ds); |
|
|
2680 | } |
2666 | } |
2681 | |
2667 | |
2682 | /* ------------------------------------------------------------------------- */ |
2668 | /* ------------------------------------------------------------------------- */ |
2683 | /* |
2669 | /* |
2684 | * Respond to a notification that a primary selection has been sent |
2670 | * Respond to a notification that a primary selection has been sent |