|
|
@ -210,19 +210,33 @@ static char *opt_title = NULL;
|
|
|
|
void
|
|
|
|
void
|
|
|
|
clipcopy(const Arg *dummy)
|
|
|
|
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
|
|
|
|
void
|
|
|
|
clippaste(const Arg *dummy)
|
|
|
|
clippaste(const Arg *dummy)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xclippaste();
|
|
|
|
Atom clipboard;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
|
|
|
|
|
|
|
|
XConvertSelection(xw.dpy, clipboard, xsel.xtarget, clipboard,
|
|
|
|
|
|
|
|
xw.win, CurrentTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
selpaste(const Arg *dummy)
|
|
|
|
selpaste(const Arg *dummy)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xselpaste();
|
|
|
|
XConvertSelection(xw.dpy, XA_PRIMARY, xsel.xtarget, XA_PRIMARY,
|
|
|
|
|
|
|
|
xw.win, CurrentTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
@ -518,36 +532,10 @@ selnotify(XEvent *e)
|
|
|
|
XDeleteProperty(xw.dpy, xw.win, (int)property);
|
|
|
|
XDeleteProperty(xw.dpy, xw.win, (int)property);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
|
|
xselpaste(void)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
XConvertSelection(xw.dpy, XA_PRIMARY, xsel.xtarget, XA_PRIMARY,
|
|
|
|
|
|
|
|
xw.win, CurrentTime);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
xclipcopy(void)
|
|
|
|
xclipcopy(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Atom clipboard;
|
|
|
|
clipcopy(NULL);
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
@ -634,7 +622,7 @@ brelease(XEvent *e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (e->xbutton.button == Button2) {
|
|
|
|
if (e->xbutton.button == Button2) {
|
|
|
|
xselpaste();
|
|
|
|
selpaste(NULL);
|
|
|
|
} else if (e->xbutton.button == Button1) {
|
|
|
|
} else if (e->xbutton.button == Button1) {
|
|
|
|
if (sel.mode == SEL_READY) {
|
|
|
|
if (sel.mode == SEL_READY) {
|
|
|
|
getbuttoninfo(e);
|
|
|
|
getbuttoninfo(e);
|
|
|
|