pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/25750: aterm's cut'n'paste doesn't work between 64bit and 32bit platforms



>Number:         25750
>Category:       pkg
>Synopsis:       aterm's cut'n'paste doesn't work between 64bit and 32bit 
>platforms
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 30 11:46:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Joachim Kuebart
>Release:        NetBSD 2.0B, sources from around April 2, 2004.
>Organization:
>Environment:
        
        
System: NetBSD jaja 2.0B NetBSD 2.0B (ALPHA-$Revision: 1.191 $) #10: Thu Apr 22 
17:37:18 CEST 2004 joki@jaja:/home/joki/NetBSD/compile/JAJA alpha
Architecture: alpha
Machine: alpha
aterm-0.4.2nb4
>Description:
Pasting a selection from an aterm running on a 64bit platform into
an application running on a 32bit platform doesn't always work.
        
>How-To-Repeat:
Run aterm on a 64bit platform (here: alpha) and make a selection.
Try to paste this into a client running on a 32bit platfrom (here:
opera on i386). Opera complains about an unknown Atom and no text
is pasted.
        
>Fix:
        
This is due to a wrong format specification in a call to XSetProperty()
from selection_send() for sending X Atoms. Fixing the arguments to
XSetProperty() solves the problem. The comment which was removed
indicates some experimentation has gone on here in the past, but
it was apparently unsuccessful.

Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/x11/aterm/distinfo,v
retrieving revision 1.6
diff -u -r1.6 distinfo
--- distinfo    25 Aug 2002 21:52:30 -0000      1.6
+++ distinfo    30 May 2004 11:39:32 -0000
@@ -6,4 +6,5 @@
 SHA1 (patch-ab) = 9b4e6785912de338db958e9ad48c4cafcb344270
 SHA1 (patch-ac) = 28c79343079680251a013ec3fe364b01f5a5ccac
 SHA1 (patch-ad) = 0c87ee69672e98189afa2cfdcdd9691a1571f354
-SHA1 (patch-ae) = b4bbe033f29a8ee24cfff511fb59739d3582341d
+SHA1 (patch-ae) = cc35107d24362f8bf31badb7aa9e4aec069171b2
+SHA1 (patch-af) = e8e41fbc9837e87bc6bc495b4b698617bd1ea2ea

-------------------- New file: patches/patch-af:
$NetBSD$

--- src/screen.c.orig   2001-09-06 18:38:07.000000000 +0200
+++ src/screen.c        2004-05-30 12:43:05.000000000 +0200
@@ -3313,14 +3313,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
  */
@@ -3329,7 +3321,7 @@
 selection_send(XSelectionRequestEvent * rq)
 {
     XEvent          ev;
-    Atom32          target_list[2];
+    Atom            target_list[2];
     static Atom     xa_targets = None;
 
     if (xa_targets == None)
@@ -3344,10 +3336,10 @@
     ev.xselection.time = rq->time;
 
     if (rq->target == xa_targets) {
-       target_list[0] = (Atom32) xa_targets;
-       target_list[1] = (Atom32) XA_STRING;
-       XChangeProperty(Xdisplay, rq->requestor, rq->property, rq->target,
-                       (8 * sizeof(target_list[0])), PropModeReplace,
+       target_list[0] = xa_targets;
+       target_list[1] = XA_STRING;
+       XChangeProperty(Xdisplay, rq->requestor, rq->property, XA_ATOM,
+                       32, PropModeReplace,
                        (unsigned char *)target_list,
                        (sizeof(target_list) / sizeof(target_list[0])));
        ev.xselection.property = rq->property;
-------------------- End of new file: patches/patch-af:

While we're at it, the patch below also changes aterm's function
key codes F1..F4 from the old-fashioned \E[11... to the \E[OP...
used in modern xterms. This makes aterm work with NetBSD's xterm
termcap entry (aterm sets $TERM to xterm by default). Please note
that this patch is orthogonal to the above.

cvs server: Diffing patches
Index: patches/patch-ae
===================================================================
RCS file: /cvsroot/pkgsrc/x11/aterm/patches/patch-ae,v
retrieving revision 1.2
diff -u -r1.2 patch-ae
--- patches/patch-ae    25 Aug 2002 21:52:31 -0000      1.2
+++ patches/patch-ae    30 May 2004 11:39:32 -0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-ae,v 1.2 2002/08/25 21:52:31 jlam Exp $
+$NetBSD$
 
---- src/command.c.orig Thu Sep  6 18:38:07 2001
-+++ src/command.c
+--- src/command.c.orig 2004-05-20 12:10:08.000000000 +0200
++++ src/command.c      2004-05-20 12:09:37.000000000 +0200
 @@ -1146,6 +1146,11 @@
      num_fds = getdtablesize();
  #endif
@@ -14,7 +14,34 @@
  #ifdef META8_OPTION
      meta_char = (Options & Opt_meta8 ? 0x80 : 033);
      if (rs_modifier
-@@ -2024,7 +2029,7 @@
+@@ -1763,16 +1768,21 @@
+               }
+               break;
+ 
++          case XK_F1:         /* "\033OP" */
++          case XK_F2:         /* "\033OQ" */
++          case XK_F3:         /* "\033OR" */
++          case XK_F4:         /* "\033OS" */
++              len = 3;
++              STRCPY(kbuf, "\033OP");
++              kbuf[2] += (keysym - XK_F1);
++              break;
++
+ #define FKEY(n, fkey)                                                 \
+     len = 5;                                                          \
+     sprintf((char *) kbuf,"\033[%02d~", (int)((n) + (keysym - fkey)))
+ 
+-          case XK_F1:         /* "\033[11~" */
+-          case XK_F2:         /* "\033[12~" */
+-          case XK_F3:         /* "\033[13~" */
+-          case XK_F4:         /* "\033[14~" */
+           case XK_F5:         /* "\033[15~" */
+-              FKEY(11, XK_F1);
++              FKEY(15, XK_F5);
+               break;
+ 
+           case XK_F6:         /* "\033[17~" */
+@@ -2024,7 +2034,7 @@
  #endif
  
      /* See if we can read from the application */
>Release-Note:
>Audit-Trail:
>Unformatted:
        
        



Home | Main Index | Thread Index | Old Index