diff options
author | George Peter Staplin <gps@Georges-Workstation.local> | 2008-09-25 12:29:57 -0600 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-09-26 12:31:29 -0700 |
commit | edfa3f8233fde490cb4255f21473684e96d595a3 (patch) | |
tree | 9db5c01bc0871aaf7f27632b9e7ccbb7ddc4db45 /hw/xquartz/pbproxy | |
parent | 12a59c44cb68843a60fc43257930d1cbeb971b7a (diff) |
XQuartz: pbproxy: Fix a bug that rxvt brought out in STRING copying. Now I can copy and paste to/from rxvt correctly.
(cherry picked from commit 82a4dc5f0f31a7911ee1cce5d1b162077befa811)
Diffstat (limited to 'hw/xquartz/pbproxy')
-rw-r--r-- | hw/xquartz/pbproxy/x-selection.m | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/hw/xquartz/pbproxy/x-selection.m b/hw/xquartz/pbproxy/x-selection.m index 955603228..14f69679d 100644 --- a/hw/xquartz/pbproxy/x-selection.m +++ b/hw/xquartz/pbproxy/x-selection.m @@ -890,8 +890,10 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato return; } - DB ("e->selection %s\n", XGetAtomName (x_dpy, e->selection)); - DB ("e->property %s\n", XGetAtomName (x_dpy, e->property)); +#if 0 + printf ("e->selection %s\n", XGetAtomName (x_dpy, e->selection)); + printf ("e->property %s\n", XGetAtomName (x_dpy, e->property)); +#endif if ([self is_incr_type:e]) { @@ -1114,11 +1116,14 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato pbtypes = [NSArray arrayWithObjects:NSStringPboardType, nil]; - if (nil != pbtypes) + if (nil == pbtypes) { - [pb declareTypes:pbtypes owner:nil]; - [pb setString:string forType:NSStringPboardType]; + [string autorelease]; + return; } + + [pb declareTypes:pbtypes owner:nil]; + [pb setString:string forType:NSStringPboardType]; [string autorelease]; } @@ -1138,7 +1143,14 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato free_propdata (pdata); return; } - + +#if 0 + if (None != request_atom) + printf ("request_atom %s\n", XGetAtomName (x_dpy, request_atom)); + + printf ("type %s\n", XGetAtomName (x_dpy, type)); +#endif + if (request_atom == atoms->targets && type == atoms->atom) { [self handle_targets:selection propdata:pdata]; @@ -1159,7 +1171,7 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato { [self handle_string:pdata pasteboard:pb]; } - + free_propdata(pdata); [self copy_completed:selection]; @@ -1244,6 +1256,7 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato atoms->clipboard = XInternAtom (x_dpy, "CLIPBOARD", False); atoms->text = XInternAtom (x_dpy, "TEXT", False); atoms->utf8_string = XInternAtom (x_dpy, "UTF8_STRING", False); + atoms->string = XInternAtom (x_dpy, "STRING", False); atoms->targets = XInternAtom (x_dpy, "TARGETS", False); atoms->multiple = XInternAtom (x_dpy, "MULTIPLE", False); atoms->cstring = XInternAtom (x_dpy, "CSTRING", False); |