Skip to content

Reported issue patching history & transparency #37

Description

@juliusHuelsmann

Hi I was patching in st to include both of your patches. And I noticed that they accidentally conflict with each other and I think I should let you know just in case you care to do something about it. It's very simple, adding in both of your patches causes a stack overflow because there is an infinite recursion between the three following functions. Removing the xsetsel call in clipcopy removes the recursion and allows the behavior of both patches to come through. I'm not sure how you guys want to approach it or what the etiquette here is. I suggest at least warning users and maybe giving them this quick solution. Anyways thanks for your work I hope you can improve this for the good of st users.

void
clipcopy(const Arg *dummy)
{
Atom clipboard;

free(xsel.clipboard);
xsel.clipboard = NULL;
//xsetsel(getsel()); Added by Vim Browse, my suggestion is to delete this only if both are used

if (xsel.primary != NULL) {
    xsel.clipboard = xstrdup(xsel.primary);
    clipboard = XInternAtom(xw.dpy, "CLIPBOARD", 0);
    XSetSelectionOwner(xw.dpy, clipboard, xw.win, CurrentTime);
}

}

void
setsel(char *str, Time t)
{
if (!str)
return;

free(xsel.primary);
xsel.primary = str;

XSetSelectionOwner(xw.dpy, XA_PRIMARY, xw.win, t);
if (XGetSelectionOwner(xw.dpy, XA_PRIMARY) != xw.win)
    selclear();
clipcopy(NULL); // Added by one clipboard

}

void
xsetsel(char *str)
{
setsel(str, CurrentTime);
}

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions