[Xquartz-dev] Suggested patch for 64-bit pbproxy in SL

Jeremy Huddleston jeremyhu at apple.com
Fri Sep 4 11:25:47 PDT 2009


Actually, from X.h:

/*
  * _XSERVER64 must ONLY be defined when compiling X server sources on
  * systems where unsigned long is not 32 bits, must NOT be used in
  * client or library code.
  */

So it looks like the *CLIENT* Atom is supposed to be long.  The  
*SERVER* Atom is supposed to be 32bits.

...

Martin, can you #define TEST in x-selection.m and see what crops up in  
get_property() ... my guess is that the Atoms are being sent as 32bit  
from the server (format = 32bit)... and we just need to interpret them  
as 32bit values... but there should be a more elegant way in to do  
that...

Maybe we'll just have to store format in the propdata struct... ick.   
this is sounding messy.

Thanks,
Jeremy

On Sep 4, 2009, at 11:09, Jeremy Huddleston wrote:

> On Sep 4, 2009, at 07:41, Martin Otte wrote:
>
>> After upgrading to SL, when using X11 I kept seeing "Atom list is  
>> not a multiple of the size of an atom!" in my system logs, and also  
>> noticed that copying between OSX and X11 was sometimes not working  
>> (especially when "Update Pasteboard immediately" was checked).
>
> I haven't looked at this in depth, but thanks for your analysis and  
> patch.  I'll get this checked into git after some testing.  Can you  
> please open a bug report as well?
>
>> On i386, sizeof(a)=4, but on x86_64, sizeof(a)=8.
>> My suggestion is just to use sizeof(int) instead of sizeof(a).  
>> Looking through the server code, it looks like Atoms are always 32- 
>> bit anyway when compiling the rest of the server, and are sizeof 
>> (long) outside of the server.
>
>> With this patch, I was able to copy an image from the OSX clipboard  
>> to an X11 application (gnumeric), and later select this image in  
>> X11 and copy it back to OSX properly.
>
> So that hints to the solution... but sizeof(a) should == sizeof 
> (Atom) == sizeof(int) ...
>
> My guess is there's something up wrt this hunk in /usr/X11/include/ 
> X11/Xdefs.h :
>
> #ifndef _XTYPEDEF_ATOM
> #  define _XTYPEDEF_ATOM
> #  ifndef _XSERVER64
> typedef unsigned long Atom;
> #  else
> typedef CARD32 Atom;
> #  endif
> #endif
>
> I'm guessing _XSERVER64 isn't getting correctly #defined for 64bit  
> somewhere...
>
>> I also removed a call to XBell in x-selection.m.
>
> Thanks.  I think that was old debugging that forgot to get punted.
>
>> For some reason, when I selected some text in an xterm (or other  
>> Xaw applications), whenever I clicked anywhere to un-highlight the  
>> selection the system would beep. This only seems to be happening in  
>> Xaw-based apps with "Update Pasteboard immediately" checked. The  
>> bell ringing was driving me crazy, so I removed the call to XBell  
>> which is probably not needed anyway.
>>
>> I hope this is useful,
>
> Yep, thanks.
>
> _______________________________________________
> Xquartz-dev mailing list
> Xquartz-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/xquartz-dev



More information about the Xquartz-dev mailing list