diff options
Diffstat (limited to '')
| -rw-r--r-- | x.c | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -148,7 +148,7 @@ static void propnotify(XEvent *); | |||
| 148 | static void selnotify(XEvent *); | 148 | static void selnotify(XEvent *); |
| 149 | static void selclear_(XEvent *); | 149 | static void selclear_(XEvent *); |
| 150 | static void selrequest(XEvent *); | 150 | static void selrequest(XEvent *); |
| 151 | static void selcopy(Time); | 151 | static void setsel(char *, Time); |
| 152 | static void getbuttoninfo(XEvent *); | 152 | static void getbuttoninfo(XEvent *); |
| 153 | static void mousereport(XEvent *); | 153 | static void mousereport(XEvent *); |
| 154 | static char *kmap(KeySym, uint); | 154 | static char *kmap(KeySym, uint); |
| @@ -441,12 +441,6 @@ bpress(XEvent *e) | |||
| 441 | } | 441 | } |
| 442 | 442 | ||
| 443 | void | 443 | void |
| 444 | selcopy(Time t) | ||
| 445 | { | ||
| 446 | xsetsel(getsel(), t); | ||
| 447 | } | ||
| 448 | |||
| 449 | void | ||
| 450 | propnotify(XEvent *e) | 444 | propnotify(XEvent *e) |
| 451 | { | 445 | { |
| 452 | XPropertyEvent *xpev; | 446 | XPropertyEvent *xpev; |
| @@ -620,7 +614,7 @@ selrequest(XEvent *e) | |||
| 620 | } | 614 | } |
| 621 | 615 | ||
| 622 | void | 616 | void |
| 623 | xsetsel(char *str, Time t) | 617 | setsel(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 | ||
| 633 | void | 627 | void |
| 628 | xsetsel(char *str) | ||
| 629 | { | ||
| 630 | setsel(str, CurrentTime); | ||
| 631 | } | ||
| 632 | |||
| 633 | void | ||
| 634 | brelease(XEvent *e) | 634 | brelease(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; |
