|
Removed
Link Here
|
| 1 |
--- src/screen.c.orig 2014-12-09 13:14:46.000000000 -0800 |
| 2 |
+++ src/screen.c 2014-12-09 13:14:57.000000000 -0800 |
| 3 |
@@ -3520,6 +3520,7 @@ |
| 4 |
Atom32 target_list[3]; |
| 5 |
#endif |
| 6 |
Atom target; |
| 7 |
+ Atom property; |
| 8 |
XTextProperty ct; |
| 9 |
XICCEncodingStyle style; |
| 10 |
char *cl[2], dummy[1]; |
| 11 |
@@ -3532,6 +3533,15 @@ |
| 12 |
ev.target = rq->target; |
| 13 |
ev.time = rq->time; |
| 14 |
|
| 15 |
+ /* ICCCM: 2.2. Responsibilities of the Selection Owner |
| 16 |
+ * SelectionRequest: |
| 17 |
+ * If the specified property is None , the requestor |
| 18 |
+ * an obsolete client. Owners are encouraged |
| 19 |
+ * to support these clients by using the specified |
| 20 |
+ * target atom as the property name to be used for |
| 21 |
+ * the reply. |
| 22 |
+ */ |
| 23 |
+ property = (rq->property == 0) ? rq->target : rq->property; |
| 24 |
if (rq->target == r->h->xa[XA_TARGETS]) { |
| 25 |
target_list[0] = (Atom32) r->h->xa[XA_TARGETS]; |
| 26 |
target_list[1] = (Atom32) XA_STRING; |
| 27 |
@@ -3539,7 +3549,7 @@ |
| 28 |
#ifdef USE_XIM |
| 29 |
target_list[3] = (Atom32) r->h->xa[XA_COMPOUND_TEXT]; |
| 30 |
#endif |
| 31 |
- XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_ATOM, |
| 32 |
+ XChangeProperty(r->Xdisplay, rq->requestor, property, XA_ATOM, |
| 33 |
(8 * sizeof(target_list[0])), PropModeReplace, |
| 34 |
(unsigned char *)target_list, |
| 35 |
(sizeof(target_list) / sizeof(target_list[0]))); |
| 36 |
@@ -3547,10 +3557,10 @@ |
| 37 |
} else if (rq->target == r->h->xa[XA_MULTIPLE]) { |
| 38 |
/* TODO: Handle MULTIPLE */ |
| 39 |
} else if (rq->target == r->h->xa[XA_TIMESTAMP] && r->selection.text) { |
| 40 |
- XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_INTEGER, |
| 41 |
- (8 * sizeof(Time)), PropModeReplace, |
| 42 |
+ XChangeProperty(r->Xdisplay, rq->requestor, property, XA_INTEGER, |
| 43 |
+ 32, PropModeReplace, |
| 44 |
(unsigned char *)&r->h->selection_time, 1); |
| 45 |
- ev.property = rq->property; |
| 46 |
+ ev.property = property; |
| 47 |
} else if (rq->target == XA_STRING |
| 48 |
|| rq->target == r->h->xa[XA_COMPOUND_TEXT] |
| 49 |
|| rq->target == r->h->xa[XA_TEXT]) { |
| 50 |
@@ -3588,10 +3598,10 @@ |
| 51 |
ct.value = (unsigned char *)cl[0]; |
| 52 |
ct.nitems = selectlen; |
| 53 |
} |
| 54 |
- XChangeProperty(r->Xdisplay, rq->requestor, rq->property, |
| 55 |
+ XChangeProperty(r->Xdisplay, rq->requestor, property, |
| 56 |
target, 8, PropModeReplace, |
| 57 |
ct.value, (int)ct.nitems); |
| 58 |
- ev.property = rq->property; |
| 59 |
+ ev.property = property; |
| 60 |
#ifdef USE_XIM |
| 61 |
if (freect) |
| 62 |
XFree(ct.value); |