diff --git a/lib/xcore.js b/lib/xcore.js index 1586d67..0ed9532 100644 --- a/lib/xcore.js +++ b/lib/xcore.js @@ -334,6 +334,7 @@ XClient.prototype.unpackEvent = function(type, seq, extra, code, raw, headerBuf) var values = raw.unpack('LLssSSSC'); event.name = 'ConfigureNotify'; event.wid = extra; + // TODO rename event.wid1 = values[0]; event.aboveSibling = values[1]; event.x = values[2]; @@ -364,7 +365,7 @@ XClient.prototype.unpackEvent = function(type, seq, extra, code, raw, headerBuf) } else if (type == 28) {// PropertyNotify event.name = 'PropertyNotify'; var values = raw.unpack('LLC'); - event.window = extra; + event.wid = extra; event.atom = values[0]; event.time = values[1]; event.state = values[2]; @@ -376,6 +377,7 @@ XClient.prototype.unpackEvent = function(type, seq, extra, code, raw, headerBuf) event.selection = values[1]; } else if (type == 30) {// SelectionRequest event.name = 'SelectionRequest'; + // TODO check this event.time = extra; var values = raw.unpack('LLLLL'); event.owner = values[0]; @@ -385,6 +387,7 @@ XClient.prototype.unpackEvent = function(type, seq, extra, code, raw, headerBuf) event.property = values[4]; } else if (type == 31) {// SelectionNotify event.name = 'SelectionNotify'; + // TODO check this event.time = extra; var values = raw.unpack('LLLL'); event.requestor = values[0]; @@ -403,6 +406,7 @@ XClient.prototype.unpackEvent = function(type, seq, extra, code, raw, headerBuf) event.request = headerBuf[4]; event.firstKeyCode = headerBuf[5]; event.count = headerBuf[6]; + // TODO cleanup console.log(values); console.log(raw); } diff --git a/test/change-property.js b/test/change-property.js index 2c9a94c..6090856 100644 --- a/test/change-property.js +++ b/test/change-property.js @@ -33,7 +33,7 @@ describe('ChangeProperty', function() { self.X.once('event', function(ev) { ev.type.should.equal(28); ev.atom.should.equal(atom); - ev.window.should.equal(self.wid); + ev.wid.should.equal(self.wid); self.X.GetProperty(0, self.wid, atom, self.X.atoms.WINDOW, 0, 1000000000, function(err, prop) { should.not.exist(err); prop.data.readUInt32LE(0).should.equal(self.wid); @@ -54,7 +54,7 @@ describe('ChangeProperty', function() { self.X.once('event', function(ev) { ev.type.should.equal(28); ev.atom.should.equal(atom); - ev.window.should.equal(self.wid); + ev.wid.should.equal(self.wid); self.X.GetProperty(0, self.wid, atom, self.X.atoms.ATOM, 0, 1000000000, function(err, prop) { should.not.exist(err); prop.data.readUInt32LE(0).should.equal(self.wid); @@ -74,7 +74,7 @@ describe('ChangeProperty', function() { self.X.once('event', function(ev) { ev.type.should.equal(28); ev.atom.should.equal(atom); - ev.window.should.equal(self.wid); + ev.wid.should.equal(self.wid); self.X.GetProperty(0, self.wid, atom, self.X.atoms.WINDOW, 0, 1000000000, function(err, prop) { should.not.exist(err); prop.data.length.should.equal(0);