diff --git a/lib/x11/corereqs.js b/lib/x11/corereqs.js index e94cd9e..5df9543 100644 --- a/lib/x11/corereqs.js +++ b/lib/x11/corereqs.js @@ -117,8 +117,16 @@ module.exports = { // create request packet - function OR format string function(id, parentId, x, y, width, height, borderWidth, depth, _class, visual, values) { - // TODO: ??? there is depth field in xproto, but xlib just sets it to zero - // var depth = 0; + if (borderWidth === undefined) + borderWidth = 0; + if (depth === undefined) + depth = 0; + if (_class === undefined) + _class = 0; + if (visual === undefined) + visual = 0; + if (values === undefined) + values = {} var packetLength = 8 + (values ? Object.keys(values).length : 0); // TODO: should be CCSLLssSSSSLL - x,y are signed @@ -185,6 +193,7 @@ module.exports = { ['CxSL', [3, 2]], function(buf) { + // TODO: change from array to named object fields var res = buf.unpack('LSCCLLCCCCCLLLS'); return res; }