dec = base64dec(strescseq.args[2]);
if (dec) {
- xsetsel(dec, CurrentTime);
+ xsetsel(dec);
xclipcopy();
} else {
fprintf(stderr, "erresc: invalid base64\n");
static void selnotify(XEvent *);
static void selclear_(XEvent *);
static void selrequest(XEvent *);
-static void selcopy(Time);
+static void setsel(char *, Time);
static void getbuttoninfo(XEvent *);
static void mousereport(XEvent *);
static char *kmap(KeySym, uint);
}
}
-void
-selcopy(Time t)
-{
- xsetsel(getsel(), t);
-}
-
void
propnotify(XEvent *e)
{
}
void
-xsetsel(char *str, Time t)
+setsel(char *str, Time t)
{
free(sel.primary);
sel.primary = str;
selclear_(NULL);
}
+void
+xsetsel(char *str)
+{
+ setsel(str, CurrentTime);
+}
+
void
brelease(XEvent *e)
{
} else if (e->xbutton.button == Button1) {
if (sel.mode == SEL_READY) {
getbuttoninfo(e);
- selcopy(e->xbutton.time);
+ setsel(getsel(), e->xbutton.time);
} else
selclear_(NULL);
sel.mode = SEL_IDLE;