diff --git a/examples/smoketest/listproperties.js b/examples/smoketest/listproperties.js new file mode 100644 index 0000000..4aa3b41 --- /dev/null +++ b/examples/smoketest/listproperties.js @@ -0,0 +1,9 @@ +var x11 = require('../../lib/x11'); + +x11.createClient(function(display) { + var X = display.client; + var root = display.screen[0].root; + X.ListProperties(root, function(err, atoms) { console.log(atoms); }); + //X.on('event', console.log); + //X.on('error', console.error); +}); diff --git a/lib/x11/corereqs.js b/lib/x11/corereqs.js index 5dd5d05..c0a1630 100644 --- a/lib/x11/corereqs.js +++ b/lib/x11/corereqs.js @@ -316,6 +316,27 @@ module.exports = { } ], + ListProperties: [ + + function(wid) + { + return ['CxSL', [21, 2, wid]]; + }, + + function(buf) { + console.log(buf); + var n = buf.unpack('S')[0]; + console.log(n); + var i; + var atoms = []; + for(i=0; i < n; ++i) { + atoms.push(buf.unpack('L', 24+4*i)); + //console.log([n, i, atoms]); + } + return atoms; + } + ], + SendEvent: [ function(destination, propagate, eventMask, eventRawData)