--- rxvt-unicode/src/screen.C 2006/01/18 09:40:53 1.236 +++ rxvt-unicode/src/screen.C 2006/01/19 23:15:21 1.243 @@ -236,7 +236,6 @@ selection.op = SELECTION_CLEAR; selection.screen = PRIMARY; selection.clicks = 0; - CLEAR_ALL_SELECTION (); rvideo = 0; } else @@ -327,6 +326,10 @@ int qcol = 0; + // see below for cursor adjustment rationale + if (p == ocur.row) + screen.cur.row = q - (total_rows - nrow); + // fill a single destination line while (lofs < llen && qcol < ncol) { @@ -346,8 +349,10 @@ int len = min (min (prev_ncol - pcol, ncol - qcol), llen - lofs); +#if DEBUG_STRICT assert (len); assert (pline.t); +#endif memcpy (qline->t + qcol, pline.t + pcol, len * sizeof (text_t)); memcpy (qline->r + qcol, pline.r + pcol, len * sizeof (rend_t)); @@ -391,11 +396,6 @@ term_start = 0; } -#ifdef DEBUG_STRICT //TODO: remove - for (int i = top_row; i < nrow; i++) - assert (ROW (i).t); -#endif - free (old_buf); delete old_ta; delete old_ra; @@ -407,6 +407,8 @@ free (tabs); } + CLEAR_ALL_SELECTION (); + prev_nrow = nrow; prev_ncol = ncol; @@ -462,7 +464,7 @@ * XTERM_SEQ: Restore cursor: ESC 8 */ void -rxvt_term::scr_cursor (int mode) +rxvt_term::scr_cursor (cursor_mode mode) { screen_t *s; @@ -634,7 +636,7 @@ { // basically this is a slightly optimized scr_blank_screen_mem // it is worth the effort on slower machines - line_t &l = ROW(row2 - i); + line_t &l = ROW(nrow - 1 - i); scr_blank_line (l, 0, l.l, rstyle); @@ -2802,11 +2804,13 @@ * EXT: button 2 release */ void -rxvt_term::selection_request (Time tm, int x, int y) +rxvt_term::selection_request (Time tm, int selnum) { - if (x < 0 || x >= width || y < 0 || y >= height) - return; /* outside window */ - +/* After making a selection with selection_make this function will always + * return the internal selection, which is not correct IMO, now much more since + * I added the selnum parameter. + */ +#if 0 if (selection.text) { /* internal selection */ char *str = rxvt_wcstombs (selection.text, selection.len); @@ -2815,24 +2819,20 @@ return; } else +#endif { - int i; - selection_request_time = tm; selection_wait = Sel_normal; - for (i = Sel_Primary; i <= Sel_Clipboard; i++) - { #if X_HAVE_UTF8_STRING - selection_type = Sel_UTF8String; - if (selection_request_other (xa[XA_UTF8_STRING], i)) - return; + selection_type = Sel_UTF8String; + if (selection_request_other (xa[XA_UTF8_STRING], selnum)) + return; #else - selection_type = Sel_CompoundText; - if (selection_request_other (xa[XA_COMPOUND_TEXT], i)) - return; + selection_type = Sel_CompoundText; + if (selection_request_other (xa[XA_COMPOUND_TEXT], selnum)) + return; #endif - } } selection_wait = Sel_none; /* don't loop in selection_paste () */