From 07cbcea4d7275e5abf6b871bec2efd58593385da Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Tue, 26 Feb 2013 11:25:53 +1100 Subject: [PATCH] hash instead of array in GetWindowAttributes result --- lib/corereqs.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/corereqs.js b/lib/corereqs.js index 28f884f..7e20019 100644 --- a/lib/corereqs.js +++ b/lib/corereqs.js @@ -190,11 +190,20 @@ module.exports = { GetWindowAttributes: [ ['CxSL', [3, 2]], - function(buf) + function(buf, backingStore) { // TODO: change from array to named object fields - var res = buf.unpack('LSCCLLCCCCCLLLS'); - return res; + var res = buf.unpack('LSCCLLCCCCLLLS'); + var ret = { + backingStore: backingStore + }; + ( "visual klass bitGravity winGravity backingPlanes backingPixel" + + " saveUnder mapIsInstalled mapState overrideRedirect colormap" + + " allEventMasks myEventMasks doNotPropogateMask" ) + .split(' ').forEach(function(field, index) { + ret[field] = res[index]; + }); + return ret; } ],