diff options
Diffstat (limited to 'st.c')
| -rw-r--r-- | st.c | 9 |
1 files changed, 9 insertions, 0 deletions
| @@ -311,6 +311,7 @@ static void brelease(XEvent *); | |||
| 311 | static void bpress(XEvent *); | 311 | static void bpress(XEvent *); |
| 312 | static void bmotion(XEvent *); | 312 | static void bmotion(XEvent *); |
| 313 | static void selnotify(XEvent *); | 313 | static void selnotify(XEvent *); |
| 314 | static void selclear(XEvent *); | ||
| 314 | static void selrequest(XEvent *); | 315 | static void selrequest(XEvent *); |
| 315 | 316 | ||
| 316 | static void selinit(void); | 317 | static void selinit(void); |
| @@ -336,6 +337,7 @@ static void (*handler[LASTEvent])(XEvent *) = { | |||
| 336 | [MotionNotify] = bmotion, | 337 | [MotionNotify] = bmotion, |
| 337 | [ButtonPress] = bpress, | 338 | [ButtonPress] = bpress, |
| 338 | [ButtonRelease] = brelease, | 339 | [ButtonRelease] = brelease, |
| 340 | [SelectionClear] = selclear, | ||
| 339 | [SelectionNotify] = selnotify, | 341 | [SelectionNotify] = selnotify, |
| 340 | [SelectionRequest] = selrequest, | 342 | [SelectionRequest] = selrequest, |
| 341 | }; | 343 | }; |
| @@ -612,6 +614,13 @@ selpaste() { | |||
| 612 | XConvertSelection(xw.dpy, XA_PRIMARY, sel.xtarget, XA_PRIMARY, xw.win, CurrentTime); | 614 | XConvertSelection(xw.dpy, XA_PRIMARY, sel.xtarget, XA_PRIMARY, xw.win, CurrentTime); |
| 613 | } | 615 | } |
| 614 | 616 | ||
| 617 | void selclear(XEvent *e) { | ||
| 618 | if(sel.bx == -1) | ||
| 619 | return; | ||
| 620 | sel.bx = -1; | ||
| 621 | tsetdirt(sel.b.y, sel.e.y); | ||
| 622 | } | ||
| 623 | |||
| 615 | void | 624 | void |
| 616 | selrequest(XEvent *e) { | 625 | selrequest(XEvent *e) { |
| 617 | XSelectionRequestEvent *xsre; | 626 | XSelectionRequestEvent *xsre; |
