Fixing the clipboard copying to st itself.

dev
Christoph Lohmann 2013-01-20 17:12:41 +01:00
parent 3036051fb1
commit 57f39defaf
1 changed files with 9 additions and 2 deletions

11
st.c
View File

@ -793,6 +793,7 @@ void selclear(XEvent *e) {
void void
selrequest(XEvent *e) { selrequest(XEvent *e) {
fprintf(stderr, "selrequest\n");
XSelectionRequestEvent *xsre; XSelectionRequestEvent *xsre;
XSelectionEvent xev; XSelectionEvent xev;
Atom xa_targets, string; Atom xa_targets, string;
@ -828,6 +829,7 @@ selrequest(XEvent *e) {
void void
xsetsel(char *str) { xsetsel(char *str) {
fprintf(stderr, "xsetsel: %s\n", str);
/* register the selection for both the clipboard and the primary */ /* register the selection for both the clipboard and the primary */
Atom clipboard; Atom clipboard;
@ -842,6 +844,7 @@ xsetsel(char *str) {
void void
brelease(XEvent *e) { brelease(XEvent *e) {
fprintf(stderr, "brelease\n");
struct timeval now; struct timeval now;
if(IS_SET(MODE_MOUSE)) { if(IS_SET(MODE_MOUSE)) {
@ -2479,6 +2482,7 @@ xzoom(const Arg *arg)
void void
xinit(void) { xinit(void) {
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
XGCValues gcvalues;
Cursor cursor; Cursor cursor;
Window parent; Window parent;
int sw, sh, major, minor; int sw, sh, major, minor;
@ -2544,7 +2548,10 @@ xinit(void) {
usedbe = True; usedbe = True;
} else { } else {
*/ */
dc.gc = XCreateGC(xw.dpy, parent, 0, 0); memset(&gcvalues, 0, sizeof(gcvalues));
gcvalues.graphics_exposures = False;
dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
&gcvalues);
xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h,
DefaultDepth(xw.dpy, xw.scr)); DefaultDepth(xw.dpy, xw.scr));
XSetForeground(xw.dpy, dc.gc, 0); XSetForeground(xw.dpy, dc.gc, 0);
@ -2872,7 +2879,6 @@ draw(void) {
XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, xw.w, XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, xw.w,
xw.h, 0, 0); xw.h, 0, 0);
XSetForeground(xw.dpy, dc.gc, 0); XSetForeground(xw.dpy, dc.gc, 0);
XSync(xw.dpy, False);
} }
} }
@ -3169,6 +3175,7 @@ run(void) {
XNextEvent(xw.dpy, &ev); XNextEvent(xw.dpy, &ev);
if(XFilterEvent(&ev, None)) if(XFilterEvent(&ev, None))
continue; continue;
fprintf(stderr, "ev.type = %d\n", ev.type);
if(handler[ev.type]) if(handler[ev.type])
(handler[ev.type])(&ev); (handler[ev.type])(&ev);
} }