aboutsummaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2017-10-17 15:43:32 -0500
committerDevin J. Pohly <djpohly@gmail.com>2018-02-25 21:53:24 -0600
commit428f01969aaf48ffa2983746c0a397bcc8946799 (patch)
tree5ad1ccfaf6ac0599498b0d7795fe7002b365d19f /x.c
parent65976c1a29f2945c3cfb6af74cd6440cf193021d (diff)
Inline clipboard functions
No need to keep a function that only calls another function in the same file. Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Diffstat (limited to 'x.c')
-rw-r--r--x.c50
1 files changed, 19 insertions, 31 deletions
diff --git a/x.c b/x.c
index cb8c351..46356fe 100644
--- a/x.c
+++ b/x.c
@@ -210,19 +210,33 @@ static char *opt_title = NULL;
void
clipcopy(const Arg *dummy)
{
- xclipcopy();
+ Atom clipboard;
+
+ if (sel.clipboard != NULL)
+ free(sel.clipboard);
+
+ if (sel.primary != NULL) {
+ sel.clipboard = xstrdup(sel.primary);
+ clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
+ XSetSelectionOwner(xw.dpy, clipboard, xw.win, CurrentTime);
+ }
}
void
clippaste(const Arg *dummy)
{
- xclippaste();
+ Atom clipboard;
+
+ clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
+ XConvertSelection(xw.dpy, clipboard, xsel.xtarget, clipboard,
+ xw.win, CurrentTime);
}
void
selpaste(const Arg *dummy)
{
- xselpaste();
+ XConvertSelection(xw.dpy, XA_PRIMARY, xsel.xtarget, XA_PRIMARY,
+ xw.win, CurrentTime);
}
void
@@ -519,35 +533,9 @@ selnotify(XEvent *e)
}
void
-xselpaste(void)
-{
- XConvertSelection(xw.dpy, XA_PRIMARY, xsel.xtarget, XA_PRIMARY,
- xw.win, CurrentTime);
-}
-
-void
xclipcopy(void)
{
- Atom clipboard;
-
- if (sel.clipboard != NULL)
- free(sel.clipboard);
-
- if (sel.primary != NULL) {
- sel.clipboard = xstrdup(sel.primary);
- clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
- XSetSelectionOwner(xw.dpy, clipboard, xw.win, CurrentTime);
- }
-}
-
-void
-xclippaste(void)
-{
- Atom clipboard;
-
- clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
- XConvertSelection(xw.dpy, clipboard, xsel.xtarget, clipboard,
- xw.win, CurrentTime);
+ clipcopy(NULL);
}
void
@@ -634,7 +622,7 @@ brelease(XEvent *e)
}
if (e->xbutton.button == Button2) {
- xselpaste();
+ selpaste(NULL);
} else if (e->xbutton.button == Button1) {
if (sel.mode == SEL_READY) {
getbuttoninfo(e);