commit 0d084c58bb71919ac98e1bf522aeaba60787b711
parent 6f56542bd1abb3eef0c9117aa9e5ee1260ed19f0
Author: Benjamin Paul <bpaul848@gmail.com>
Date: Mon, 29 Jun 2020 17:18:53 +1000
Clipboard patch st.suckless.org/patches/clipboard/
Diffstat:
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -0,0 +1,3 @@
+*.o
+*.diff
+st
diff --git a/config.h b/config.h
@@ -174,7 +174,7 @@ static uint forcemousemod = ShiftMask;
*/
static MouseShortcut mshortcuts[] = {
/* mask button function argument release */
- { XK_ANY_MOD, Button2, selpaste, {.i = 0}, 1 },
+ { XK_ANY_MOD, Button2, clippaste, {.i = 0}, 1 },
{ ShiftMask, Button4, ttysend, {.s = "\033[5;2~"} },
{ XK_ANY_MOD, Button4, ttysend, {.s = "\031"} },
{ ShiftMask, Button5, ttysend, {.s = "\033[6;2~"} },
@@ -196,8 +196,8 @@ static Shortcut shortcuts[] = {
{ TERMMOD, XK_Home, zoomreset, {.f = 0} },
{ TERMMOD, XK_C, clipcopy, {.i = 0} },
{ TERMMOD, XK_V, clippaste, {.i = 0} },
- { TERMMOD, XK_Y, selpaste, {.i = 0} },
- { ShiftMask, XK_Insert, selpaste, {.i = 0} },
+ { TERMMOD, XK_Y, clippaste, {.i = 0} },
+ { ShiftMask, XK_Insert, clippaste, {.i = 0} },
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
};
diff --git a/x.c b/x.c
@@ -673,6 +673,7 @@ setsel(char *str, Time t)
XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
selclear();
+ clipcopy(NULL);
}
void