[hackers] [sselp] clipboard fix || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Wed, 11 Aug 2010 14:01:07 +0000 (UTC)

changeset: 14:e8b3b56a48cb
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Wed Aug 11 15:01:02 2010 +0100
files: sselp.c
description:
clipboard fix

diff -r 30d96a9ee8a6 -r e8b3b56a48cb sselp.c
--- a/sselp.c Mon Aug 09 11:58:17 2010 +0100
+++ b/sselp.c Wed Aug 11 15:01:02 2010 +0100
@@ -6,7 +6,7 @@
 
 int
 main(int argc, char *argv[]) {
- Atom utf8, type;
+ Atom clip, utf8, type;
         Display *dpy;
         Window win;
         XEvent ev;
@@ -23,15 +23,16 @@
                 return 1;
 
         utf8 = XInternAtom(dpy, "UTF8_STRING", False);
+ clip = XInternAtom(dpy, "_SSELP_STRING", False);
         win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 1, 1, 0,
                                   CopyFromParent, CopyFromParent);
- XConvertSelection(dpy, XA_PRIMARY, utf8, None, win, CurrentTime);
+ XConvertSelection(dpy, XA_PRIMARY, utf8, clip, win, CurrentTime);
 
         XNextEvent(dpy, &ev);
         if(ev.type == SelectionNotify && ev.xselection.property != None) {
                 do {
- XGetWindowProperty(dpy, win, utf8, off, BUFSIZ, False,
- utf8, &type, &fmt, &len, &more, &data);
+ XGetWindowProperty(dpy, win, ev.xselection.property, off, BUFSIZ,
+ False, utf8, &type, &fmt, &len, &more, &data);
                         fwrite(data, 1, len, stdout);
                         XFree(data);
                         off += len;
Received on Wed Aug 11 2010 - 16:01:07 CEST

This archive was generated by hypermail 2.2.0 : Wed Aug 11 2010 - 16:12:04 CEST