diff options
author | Devin J. Pohly <djpohly@gmail.com> | 2017-11-06 18:25:58 -0600 |
---|---|---|
committer | Devin J. Pohly <djpohly@gmail.com> | 2018-02-25 21:53:24 -0600 |
commit | 3bb900cd6c1c7a5364bd79bce63fdd8711bc878b (patch) | |
tree | 854f906a109a0de83576ee2d8183c1eb4477adf6 | |
parent | 323d38da20c8a1d295ab1dbc0fc7ce947ef824e1 (diff) | |
download | st-patched-3bb900cd6c1c7a5364bd79bce63fdd8711bc878b.tar.bz2 st-patched-3bb900cd6c1c7a5364bd79bce63fdd8711bc878b.tar.xz st-patched-3bb900cd6c1c7a5364bd79bce63fdd8711bc878b.zip |
Remove Time argument from xsetsel
This is an X type and should be internal to x.c.
The selcopy() function was a single line and only used in one place, so
it was inlined to reduce LOC.
Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
-rw-r--r-- | st.c | 2 | ||||
-rw-r--r-- | win.h | 2 | ||||
-rw-r--r-- | x.c | 18 |
3 files changed, 11 insertions, 11 deletions
@@ -1747,7 +1747,7 @@ strhandle(void) | |||
1747 | 1747 | ||
1748 | dec = base64dec(strescseq.args[2]); | 1748 | dec = base64dec(strescseq.args[2]); |
1749 | if (dec) { | 1749 | if (dec) { |
1750 | xsetsel(dec, CurrentTime); | 1750 | xsetsel(dec); |
1751 | xclipcopy(); | 1751 | xclipcopy(); |
1752 | } else { | 1752 | } else { |
1753 | fprintf(stderr, "erresc: invalid base64\n"); | 1753 | fprintf(stderr, "erresc: invalid base64\n"); |
@@ -16,4 +16,4 @@ int xsetcolorname(int, const char *); | |||
16 | void xsettitle(char *); | 16 | void xsettitle(char *); |
17 | int xsetcursor(int); | 17 | int xsetcursor(int); |
18 | void xsetpointermotion(int); | 18 | void xsetpointermotion(int); |
19 | void xsetsel(char *, Time); | 19 | void xsetsel(char *); |
@@ -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; |