QueryPointer result unpacking

This commit is contained in:
Andrey Sidorov 2012-12-20 00:54:19 +11:00
parent 5b17a21eff
commit a951aa26cb

View file

@ -117,6 +117,8 @@ module.exports = {
// create request packet - function OR format string
function(id, parentId, x, y, width, height, borderWidth, depth, _class, visual, values) {
console.log(values);
if (borderWidth === undefined)
borderWidth = 0;
if (depth === undefined)
@ -386,9 +388,16 @@ module.exports = {
QueryPointer: [
[ 'CxSL', [38, 2] ],
function(buf) {
var res = buf.unpack('LLSSSSS'); // TODO: should be unsigned
// TODO pack array into named fields
return res;
var res = buf.unpack('LLssssS');
return {
root: res[0],
child: res[1],
rootX: res[2],
rootY: res[3],
childX: res[4],
childY: res[5],
keyMask: res[6]
};
}
],