{
/* normal XTerm key bindings */
case XK_Insert: /* Shift+Insert = paste mouse selection */
- selection_request (ev.time, Sel_Primary);
+ selection_request (ev.time);
return;
#if TODO
/* rxvt extras */
break;
case Button2:
- if (IN_RANGE_EXC (ev.x, 0, width)
- && IN_RANGE_EXC (ev.y, 0, height)) // inside window?
- {
- if (ev.state & ShiftMask)
- selection_request (ev.time, Sel_Clipboard);
- else
- selection_request (ev.time, Sel_Primary);
- }
+ if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window?
+ selection_request (ev.time, ev.state & ShiftMask ? Sel_Clipboard : Sel_Primary);
break;
#ifdef MOUSE_WHEEL
void selection_check (int check_more) NOTHROW;
void selection_paste (Window win, Atom prop, bool delete_prop) NOTHROW;
void selection_property (Window win, Atom prop) NOTHROW;
- void selection_request (Time tm, int selnum) NOTHROW;
+ void selection_request (Time tm, int selnum = Sel_Primary) NOTHROW;
int selection_request_other (Atom target, int selnum) NOTHROW;
void selection_clear () NOTHROW;
void selection_make (Time tm);
void
rxvt_term::selection_request (Time tm, int selnum) NOTHROW
{
-/* 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)
+ if (selection.text && selnum == Sel_Primary)
{ /* internal selection */
char *str = rxvt_wcstombs (selection.text, selection.len);
paste (str, strlen (str));
return;
}
else
-#endif
{
selection_request_time = tm;
selection_wait = Sel_normal;