aboutsummaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
Diffstat (limited to 'x.c')
-rw-r--r--x.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/x.c b/x.c
index 04e2e05..a332ac9 100644
--- a/x.c
+++ b/x.c
@@ -148,7 +148,7 @@ static void propnotify(XEvent *);
148static void selnotify(XEvent *); 148static void selnotify(XEvent *);
149static void selclear_(XEvent *); 149static void selclear_(XEvent *);
150static void selrequest(XEvent *); 150static void selrequest(XEvent *);
151static void selcopy(Time); 151static void setsel(char *, Time);
152static void getbuttoninfo(XEvent *); 152static void getbuttoninfo(XEvent *);
153static void mousereport(XEvent *); 153static void mousereport(XEvent *);
154static char *kmap(KeySym, uint); 154static char *kmap(KeySym, uint);
@@ -441,12 +441,6 @@ bpress(XEvent *e)
441} 441}
442 442
443void 443void
444selcopy(Time t)
445{
446 xsetsel(getsel(), t);
447}
448
449void
450propnotify(XEvent *e) 444propnotify(XEvent *e)
451{ 445{
452 XPropertyEvent *xpev; 446 XPropertyEvent *xpev;
@@ -620,7 +614,7 @@ selrequest(XEvent *e)
620} 614}
621 615
622void 616void
623xsetsel(char *str, Time t) 617setsel(char *str, Time t)
624{ 618{
625 free(sel.primary); 619 free(sel.primary);
626 sel.primary = str; 620 sel.primary = str;
@@ -631,6 +625,12 @@ xsetsel(char *str, Time t)
631} 625}
632 626
633void 627void
628xsetsel(char *str)
629{
630 setsel(str, CurrentTime);
631}
632
633void
634brelease(XEvent *e) 634brelease(XEvent *e)
635{ 635{
636 if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) { 636 if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
@@ -643,7 +643,7 @@ brelease(XEvent *e)
643 } else if (e->xbutton.button == Button1) { 643 } else if (e->xbutton.button == Button1) {
644 if (sel.mode == SEL_READY) { 644 if (sel.mode == SEL_READY) {
645 getbuttoninfo(e); 645 getbuttoninfo(e);
646 selcopy(e->xbutton.time); 646 setsel(getsel(), e->xbutton.time);
647 } else 647 } else
648 selclear_(NULL); 648 selclear_(NULL);
649 sel.mode = SEL_IDLE; 649 sel.mode = SEL_IDLE;