Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Remove Time argument from xsetsel
[st.git]
/
x.c
diff --git
a/x.c
b/x.c
index
04e2e05
..
a332ac9
100644
(file)
--- a/
x.c
+++ b/
x.c
@@
-148,7
+148,7
@@
static void propnotify(XEvent *);
static void selnotify(XEvent *);
static void selclear_(XEvent *);
static void selrequest(XEvent *);
static void selnotify(XEvent *);
static void selclear_(XEvent *);
static void selrequest(XEvent *);
-static void se
lcopy(
Time);
+static void se
tsel(char *,
Time);
static void getbuttoninfo(XEvent *);
static void mousereport(XEvent *);
static char *kmap(KeySym, uint);
static void getbuttoninfo(XEvent *);
static void mousereport(XEvent *);
static char *kmap(KeySym, uint);
@@
-440,12
+440,6
@@
bpress(XEvent *e)
}
}
}
}
-void
-selcopy(Time t)
-{
- xsetsel(getsel(), t);
-}
-
void
propnotify(XEvent *e)
{
void
propnotify(XEvent *e)
{
@@
-620,7
+614,7
@@
selrequest(XEvent *e)
}
void
}
void
-
x
setsel(char *str, Time t)
+setsel(char *str, Time t)
{
free(sel.primary);
sel.primary = str;
{
free(sel.primary);
sel.primary = str;
@@
-630,6
+624,12
@@
xsetsel(char *str, Time t)
selclear_(NULL);
}
selclear_(NULL);
}
+void
+xsetsel(char *str)
+{
+ setsel(str, CurrentTime);
+}
+
void
brelease(XEvent *e)
{
void
brelease(XEvent *e)
{
@@
-643,7
+643,7
@@
brelease(XEvent *e)
} else if (e->xbutton.button == Button1) {
if (sel.mode == SEL_READY) {
getbuttoninfo(e);
} else if (e->xbutton.button == Button1) {
if (sel.mode == SEL_READY) {
getbuttoninfo(e);
- se
lcopy(
e->xbutton.time);
+ se
tsel(getsel(),
e->xbutton.time);
} else
selclear_(NULL);
sel.mode = SEL_IDLE;
} else
selclear_(NULL);
sel.mode = SEL_IDLE;