diff options
| author | Christoph Lohmann <20h@r-36.net> | 2013-01-20 17:12:41 +0100 |
|---|---|---|
| committer | Christoph Lohmann <20h@r-36.net> | 2013-01-20 17:12:41 +0100 |
| commit | 57f39defaf3f84b5d9efb3e7a8494cc7ff09e7af (patch) | |
| tree | 8dc3beff20c36b49efd4e22e96262953a1a12af6 | |
| parent | 3036051fb18addd8ac15eac9e0ef3ee6aeb8bbc6 (diff) | |
| download | st-57f39defaf3f84b5d9efb3e7a8494cc7ff09e7af.tar.gz st-57f39defaf3f84b5d9efb3e7a8494cc7ff09e7af.zip | |
Fixing the clipboard copying to st itself.
| -rw-r--r-- | st.c | 11 |
1 files changed, 9 insertions, 2 deletions
| @@ -793,6 +793,7 @@ void selclear(XEvent *e) { | |||
| 793 | 793 | ||
| 794 | void | 794 | void |
| 795 | selrequest(XEvent *e) { | 795 | selrequest(XEvent *e) { |
| 796 | fprintf(stderr, "selrequest\n"); | ||
| 796 | XSelectionRequestEvent *xsre; | 797 | XSelectionRequestEvent *xsre; |
| 797 | XSelectionEvent xev; | 798 | XSelectionEvent xev; |
| 798 | Atom xa_targets, string; | 799 | Atom xa_targets, string; |
| @@ -828,6 +829,7 @@ selrequest(XEvent *e) { | |||
| 828 | 829 | ||
| 829 | void | 830 | void |
| 830 | xsetsel(char *str) { | 831 | xsetsel(char *str) { |
| 832 | fprintf(stderr, "xsetsel: %s\n", str); | ||
| 831 | /* register the selection for both the clipboard and the primary */ | 833 | /* register the selection for both the clipboard and the primary */ |
| 832 | Atom clipboard; | 834 | Atom clipboard; |
| 833 | 835 | ||
| @@ -842,6 +844,7 @@ xsetsel(char *str) { | |||
| 842 | 844 | ||
| 843 | void | 845 | void |
| 844 | brelease(XEvent *e) { | 846 | brelease(XEvent *e) { |
| 847 | fprintf(stderr, "brelease\n"); | ||
| 845 | struct timeval now; | 848 | struct timeval now; |
| 846 | 849 | ||
| 847 | if(IS_SET(MODE_MOUSE)) { | 850 | if(IS_SET(MODE_MOUSE)) { |
| @@ -2479,6 +2482,7 @@ xzoom(const Arg *arg) | |||
| 2479 | void | 2482 | void |
| 2480 | xinit(void) { | 2483 | xinit(void) { |
| 2481 | XSetWindowAttributes attrs; | 2484 | XSetWindowAttributes attrs; |
| 2485 | XGCValues gcvalues; | ||
| 2482 | Cursor cursor; | 2486 | Cursor cursor; |
| 2483 | Window parent; | 2487 | Window parent; |
| 2484 | int sw, sh, major, minor; | 2488 | int sw, sh, major, minor; |
| @@ -2544,7 +2548,10 @@ xinit(void) { | |||
| 2544 | usedbe = True; | 2548 | usedbe = True; |
| 2545 | } else { | 2549 | } else { |
| 2546 | */ | 2550 | */ |
| 2547 | dc.gc = XCreateGC(xw.dpy, parent, 0, 0); | 2551 | memset(&gcvalues, 0, sizeof(gcvalues)); |
| 2552 | gcvalues.graphics_exposures = False; | ||
| 2553 | dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, | ||
| 2554 | &gcvalues); | ||
| 2548 | xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, | 2555 | xw.buf = XCreatePixmap(xw.dpy, xw.win, xw.w, xw.h, |
| 2549 | DefaultDepth(xw.dpy, xw.scr)); | 2556 | DefaultDepth(xw.dpy, xw.scr)); |
| 2550 | XSetForeground(xw.dpy, dc.gc, 0); | 2557 | XSetForeground(xw.dpy, dc.gc, 0); |
| @@ -2872,7 +2879,6 @@ draw(void) { | |||
| 2872 | XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, xw.w, | 2879 | XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, xw.w, |
| 2873 | xw.h, 0, 0); | 2880 | xw.h, 0, 0); |
| 2874 | XSetForeground(xw.dpy, dc.gc, 0); | 2881 | XSetForeground(xw.dpy, dc.gc, 0); |
| 2875 | XSync(xw.dpy, False); | ||
| 2876 | } | 2882 | } |
| 2877 | } | 2883 | } |
| 2878 | 2884 | ||
| @@ -3169,6 +3175,7 @@ run(void) { | |||
| 3169 | XNextEvent(xw.dpy, &ev); | 3175 | XNextEvent(xw.dpy, &ev); |
| 3170 | if(XFilterEvent(&ev, None)) | 3176 | if(XFilterEvent(&ev, None)) |
| 3171 | continue; | 3177 | continue; |
| 3178 | fprintf(stderr, "ev.type = %d\n", ev.type); | ||
| 3172 | if(handler[ev.type]) | 3179 | if(handler[ev.type]) |
| 3173 | (handler[ev.type])(&ev); | 3180 | (handler[ev.type])(&ev); |
| 3174 | } | 3181 | } |
