… | |
… | |
572 | * Change the colour for following text |
572 | * Change the colour for following text |
573 | */ |
573 | */ |
574 | void |
574 | void |
575 | rxvt_term::scr_color (unsigned int color, int fgbg) |
575 | rxvt_term::scr_color (unsigned int color, int fgbg) |
576 | { |
576 | { |
577 | if (color > maxTermCOLOR) |
577 | if (!IN_RANGE_INC (color, minCOLOR, maxTermCOLOR)) |
578 | color = fgbg; |
578 | color = fgbg; |
579 | |
579 | |
580 | if (fgbg == Color_fg) |
580 | if (fgbg == Color_fg) |
581 | rstyle = SET_FGCOLOR (rstyle, color); |
581 | rstyle = SET_FGCOLOR (rstyle, color); |
582 | else |
582 | else |
… | |
… | |
3021 | { |
3021 | { |
3022 | display->set_selection_owner (this); |
3022 | display->set_selection_owner (this); |
3023 | return true; |
3023 | return true; |
3024 | } |
3024 | } |
3025 | else |
3025 | else |
|
|
3026 | { |
|
|
3027 | selection_clear (); |
3026 | return false; |
3028 | return false; |
|
|
3029 | } |
3027 | |
3030 | |
3028 | #if 0 |
3031 | #if 0 |
3029 | XTextProperty ct; |
3032 | XTextProperty ct; |
3030 | |
3033 | |
3031 | if (XwcTextListToTextProperty (display->display, &selection.text, 1, XStringStyle, &ct) >= 0) |
3034 | if (XwcTextListToTextProperty (display->display, &selection.text, 1, XStringStyle, &ct) >= 0) |
… | |
… | |
3044 | void |
3047 | void |
3045 | rxvt_term::selection_click (int clicks, int x, int y) |
3048 | rxvt_term::selection_click (int clicks, int x, int y) |
3046 | { |
3049 | { |
3047 | clicks = ((clicks - 1) % 3) + 1; |
3050 | clicks = ((clicks - 1) % 3) + 1; |
3048 | selection.clicks = clicks; /* save clicks so extend will work */ |
3051 | selection.clicks = clicks; /* save clicks so extend will work */ |
|
|
3052 | |
|
|
3053 | if (clicks == 2 && !selection.rect |
|
|
3054 | && HOOK_INVOKE ((this, HOOK_SEL_EXTEND, DT_END))) |
|
|
3055 | { |
|
|
3056 | MEvent.clicks = 1; // what a mess |
|
|
3057 | selection.screen = current_screen; |
|
|
3058 | selection.op = SELECTION_CONT; |
|
|
3059 | return; |
|
|
3060 | } |
3049 | |
3061 | |
3050 | selection_start_colrow (Pixel2Col (x), Pixel2Row (y)); |
3062 | selection_start_colrow (Pixel2Col (x), Pixel2Row (y)); |
3051 | |
3063 | |
3052 | if (clicks == 2 || clicks == 3) |
3064 | if (clicks == 2 || clicks == 3) |
3053 | selection_extend_colrow (selection.mark.col, |
3065 | selection_extend_colrow (selection.mark.col, |
… | |
… | |
3349 | else if (selection.clicks == 2) |
3361 | else if (selection.clicks == 2) |
3350 | { |
3362 | { |
3351 | if (ROWCOL_IS_AFTER (selection.end, selection.beg)) |
3363 | if (ROWCOL_IS_AFTER (selection.end, selection.beg)) |
3352 | selection.end.col--; |
3364 | selection.end.col--; |
3353 | |
3365 | |
3354 | if (!HOOK_INVOKE ((this, HOOK_SEL_EXTEND, DT_END))) |
|
|
3355 | { |
|
|
3356 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3366 | selection_delimit_word (UP, &selection.beg, &selection.beg); |
3357 | selection_delimit_word (DN, &selection.end, &selection.end); |
3367 | selection_delimit_word (DN, &selection.end, &selection.end); |
3358 | } |
|
|
3359 | } |
3368 | } |
3360 | else if (selection.clicks == 3) |
3369 | else if (selection.clicks == 3) |
3361 | { |
3370 | { |
3362 | #if ENABLE_FRILLS |
3371 | #if ENABLE_FRILLS |
3363 | if (OPTION (Opt_tripleclickwords)) |
3372 | if (OPTION (Opt_tripleclickwords)) |