UnmapWindow request

This commit is contained in:
sidorares 2011-07-14 16:39:59 +10:00
parent 92016cdda8
commit 8e5758238f
2 changed files with 27 additions and 1 deletions

View file

@ -92,8 +92,13 @@ module.exports = {
}
],
MapWindow: [
// 8 - opcode, 2 - length
[ 'CxSL', [8, 2] ]
]
],
UnmapWindow: [
[ 'CxSL', [10, 2] ]
]
}

21
test/map_unmap.js Normal file
View file

@ -0,0 +1,21 @@
var x11 = require('../lib/x11');
var xclient = x11.createClient();
var mapped = true;
xclient.on('connect', function(display) {
var X = this;
var root = display.screen[0].root;
var wid = X.AllocID();
X.CreateWindow(wid, root, 10, 10, 400, 300, 1, 1, 0, { backgroundPixel: 0, eventMask: 0x00000040 });
X.MapWindow(wid);
setInterval(function() {
if (!mapped) {
X.MapWindow(wid);
} else {
X.UnmapWindow(wid);
}
mapped = !mapped;
}, 1000);
});