Skip to content

Commit

Permalink
better handling for "MULTIPLE": use a dedicated method and log a more…
Browse files Browse the repository at this point in the history
… useful error message if it is not an atom as we expect it to be

git-svn-id: https://xpra.org/svn/Xpra/trunk@1225 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 31, 2012
1 parent ab99370 commit 9ad53b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/wimpiggy/prop.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ def _get_atom(disp, d):
return None
return str(pyatom)

def _get_multiple(disp, d):
uint_struct = struct.Struct("=I")
log("get_multiple struct size=%s, len(%s)=%s", uint_struct.size, d, len(d))
if len(d)!=uint_struct.size and False:
log.info("get_multiple value is not an atom: %s", d)
return str(d)
return _get_atom(disp, d)

def get_xsettings(disp, d):
return list(bytearray(d))

Expand Down Expand Up @@ -243,7 +251,7 @@ def set_xsettings(disp, d):
# specified what 'type' one should use; you just fetch with
# AnyPropertyType and assume that what you get is a bunch of pairs of
# atoms.
"multiple-conversion": (str, 0, 32, unsupported, _get_atom, None),
"multiple-conversion": (str, 0, 32, unsupported, _get_multiple, None),
}

def _prop_encode(disp, etype, value):
Expand Down

0 comments on commit 9ad53b0

Please sign in to comment.