#262 Incompatible _MOTIF_DRAG_TARGETS property on x86_64

closed-fixed
Danny Backx
5
2006-02-10
2006-02-09
Eric Branlund
No

With lesstif 0.94.4 compiled from source on a x86_64
Linux system (kernel 2.6.11, glibc 2.3), the atoms
in the _MOTIF_DRAG_TARGETS property are stored
as 8-byte quantities rather than the 4 byte quantities
described in Daniel Dardailler's documentation.

As a demonstration of the problem, I compiled the
source code below on the x86_64 system and then
remotely displayed the resulting application to a
freshly started X server on an Mac OS X system.

#include <Xm/Xm.h>
#include <Xm/TextF.h>

int main(int argc, char* argv[])
{
XtAppContext app;
Widget shell, button;

XtSetLanguageProc(NULL, NULL, NULL);
shell = XtVaAppInitialize(&app, "Shell", NULL, 0, &argc, argv,
NULL, NULL);
button = XtVaCreateManagedWidget(
"One", xmTextFieldWidgetClass, shell, NULL
);
XtRealizeWidget(shell);
XtAppMainLoop(app);

return 0;
}

The value of the _MOTIF_DRAG_TARGETS property was

_MOTIF_DRAG_TARGETS(_MOTIF_DRAG_TARGETS) = 0x6c,
0x0, 0x3, 0x0, 0x36, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x1f, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x3, 0x0, 0x1f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0xbf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc7, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0

Performing the same exercise, but where the application
was compiled on a x86 Linux system and linked with
lesstif 0.94.4 built from source on that x86 system, the
value of the _MOTIF_DRAG_TARGETS property was

_MOTIF_DRAG_TARGETS(_MOTIF_DRAG_TARGETS) = 0x6c,
0x0, 0x3, 0x0, 0x22, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
0x0, 0x0, 0x1, 0x0, 0x1f, 0x0, 0x0, 0x0, 0x3, 0x0, 0x1f,
0x0, 0x0, 0x0, 0xbf, 0x0, 0x0, 0x0, 0xc7, 0x0, 0x0, 0x0

For comparison, I compiled the same source code as a
64-bit application on an IRIX system using SGI's Motif 1.2.4.
The value of the _MOTIF_DRAG_TARGETS property with that
version was

MOTIF_DRAG_TARGETS(_MOTIF_DRAG_TARGETS) = 0x42,
0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x26, 0x0, 0x1, 0x0, 0x0,
0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1f, 0x0, 0x4, 0x0,
0x0, 0x0, 0x1f, 0x0, 0x0, 0x0, 0x1f, 0x0, 0x0, 0x0, 0xb9,
0x0, 0x0, 0x0, 0xba

I've attached a patch against the CVS source tree as of
9 Feb 2006 which modifies lib/Xm-2.1/DragBS.c to always
record the atoms in the _MOTIF_DRAG_TARGETS property
as 4 byte quantities. The patch was calculated with

diff -Naur lesstif lesstif-modified

where lesstif was the unmodified CVS source source tree
and lesstif-modified was the modified version.

Discussion

  • Eric Branlund
    Eric Branlund
    2006-02-09

    Patch to CVS source tree for lib/Xm-2.1/DragBS.c

     
    Attachments
  • Danny Backx
    Danny Backx
    2006-02-10

    • assigned_to: nobody --> dannybackx
    • status: open --> closed-fixed