diff options
author | marha <marha@users.sourceforge.net> | 2009-09-15 15:05:16 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-15 15:05:16 +0000 |
commit | 1915b018a54e991c9289ee0c03488294e890caea (patch) | |
tree | 0eccc8afdcbcee10f91cfe418fc8c7cdcd4b0163 /xorg-server/hw/xquartz/pbproxy/x-selection.m | |
parent | 8bfa2f879ea38340a633c29120758a390b63667e (diff) | |
parent | 4db64b701ca08687df5932321d48f2ef29b99fed (diff) | |
download | vcxsrv-1915b018a54e991c9289ee0c03488294e890caea.tar.gz vcxsrv-1915b018a54e991c9289ee0c03488294e890caea.tar.bz2 vcxsrv-1915b018a54e991c9289ee0c03488294e890caea.zip |
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/hw/xquartz/pbproxy/x-selection.m')
-rw-r--r-- | xorg-server/hw/xquartz/pbproxy/x-selection.m | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xorg-server/hw/xquartz/pbproxy/x-selection.m b/xorg-server/hw/xquartz/pbproxy/x-selection.m index cd540be98..4f2d848fb 100644 --- a/xorg-server/hw/xquartz/pbproxy/x-selection.m +++ b/xorg-server/hw/xquartz/pbproxy/x-selection.m @@ -77,7 +77,7 @@ static struct { @implementation x_selection -static struct propdata null_propdata = {NULL, 0}; +static struct propdata null_propdata = {NULL, 0, 0}; #ifdef DEBUG static void @@ -212,6 +212,7 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato pdata->data = buf; pdata->length = buflen; + pdata->format = format; return /*success*/ False; } @@ -223,21 +224,20 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato - (Atom) find_preferred:(struct propdata *)pdata { Atom a = None; - size_t i; + size_t i, step; Bool png = False, jpeg = False, utf8 = False, string = False; TRACE (); - if (pdata->length % sizeof (a)) + if (pdata->format != 32) { - fprintf(stderr, "Atom list is not a multiple of the size of an atom!\n"); + fprintf(stderr, "Atom list is expected to be formatted as an array of 32bit values.\n"); return None; } - for (i = 0; i < pdata->length; i += sizeof (a)) + for (i = 0, step = pdata->format >> 3; i < pdata->length; i += step) { - a = None; - memcpy (&a, pdata->data + i, sizeof (a)); + a = (Atom)*(uint32_t *)(pdata->data + i); if (a == atoms->image_png) { |