add paste from clipboard
dc77337e
1 file(s) · +4 −2
| 52 | 52 | static unsigned int lines = 0; |
|
| 53 | 53 | static unsigned long normcol[ColLast]; |
|
| 54 | 54 | static unsigned long selcol[ColLast]; |
|
| 55 | - | static Atom utf8; |
|
| 55 | + | static Atom clip, utf8; |
|
| 56 | 56 | static Bool topbar = True; |
|
| 57 | 57 | static DC *dc; |
|
| 58 | 58 | static Item *items = NULL; |
|
| 275 | 275 | insert(NULL, nextrune(-1) - cursor); |
|
| 276 | 276 | break; |
|
| 277 | 277 | case XK_y: /* paste selection */ |
|
| 278 | - | XConvertSelection(dc->dpy, XA_PRIMARY, utf8, utf8, win, CurrentTime); |
|
| 278 | + | XConvertSelection(dc->dpy, (ev->state & ShiftMask) ? clip : XA_PRIMARY, |
|
| 279 | + | utf8, utf8, win, CurrentTime); |
|
| 279 | 280 | return; |
|
| 280 | 281 | default: |
|
| 281 | 282 | return; |
|
| 517 | 518 | selcol[ColBG] = getcolor(dc, selbgcolor); |
|
| 518 | 519 | selcol[ColFG] = getcolor(dc, selfgcolor); |
|
| 519 | 520 | ||
| 521 | + | clip = XInternAtom(dc->dpy, "CLIPBOARD", False); |
|
| 520 | 522 | utf8 = XInternAtom(dc->dpy, "UTF8_STRING", False); |
|
| 521 | 523 | ||
| 522 | 524 | /* calculate menu geometry */ |
|