Package: rxvt / 1:2.7.10-6

java-selection-paste-341200.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Debian Bug #341200
selection cannot be pasted into Java applications on amd64

Atom is a 64 bit type in the amd64 architecture but, when passing
XA_ATOM arguments to XChangeProperty, one must use a "format" argument
of 32 but pass an array of 64 bit Atoms to the function.

Original issue posted and patch provided by Martin Dorey

Applied in rxvt_2.6.4-10
--- a/src/screen.c
+++ b/src/screen.c
@@ -28,8 +28,6 @@
 #include "rxvt.h"		/* NECESSARY */
 #include "screen.intpro"	/* PROTOS for internal routines */
 
-#include <X11/Xmd.h>		/* get the typedef for CARD32 */
-
 /* ------------------------------------------------------------------------- */
 #ifdef MULTICHAR_SET
 
@@ -3498,14 +3496,6 @@
 
 /* ------------------------------------------------------------------------- */
 /*
- * On some systems, the Atom typedef is 64 bits wide.  We need to have a type
- * that is exactly 32 bits wide, because a format of 64 is not allowed by
- * the X11 protocol.
- */
-typedef CARD32  Atom32;
-
-/* ------------------------------------------------------------------------- */
-/*
  * Respond to a request for our current selection
  * EXT: SelectionRequest
  */
@@ -3515,9 +3505,9 @@
 {
     XSelectionEvent ev;
 #ifdef USE_XIM
-    Atom32          target_list[4];
+    Atom            target_list[4];
 #else
-    Atom32          target_list[3];
+    Atom            target_list[3];
 #endif
     Atom            target;
     XTextProperty   ct;
@@ -3533,15 +3523,14 @@
     ev.time = rq->time;
 
     if (rq->target == r->h->xa[XA_TARGETS]) {
-	target_list[0] = (Atom32) r->h->xa[XA_TARGETS];
-	target_list[1] = (Atom32) XA_STRING;
-	target_list[2] = (Atom32) r->h->xa[XA_TEXT];
+	target_list[0] = (Atom) r->h->xa[XA_TARGETS];
+	target_list[1] = (Atom) XA_STRING;
+	target_list[2] = (Atom) r->h->xa[XA_TEXT];
 #ifdef USE_XIM
-	target_list[3] = (Atom32) r->h->xa[XA_COMPOUND_TEXT];
+	target_list[3] = (Atom) r->h->xa[XA_COMPOUND_TEXT];
 #endif
 	XChangeProperty(r->Xdisplay, rq->requestor, rq->property, XA_ATOM,
-			(8 * sizeof(target_list[0])), PropModeReplace,
-			(unsigned char *)target_list,
+			32, PropModeReplace, (unsigned char *)target_list,
 			(sizeof(target_list) / sizeof(target_list[0])));
 	ev.property = rq->property;
     } else if (rq->target == r->h->xa[XA_MULTIPLE]) {