mirror of
https://github.com/danbulant/node-x11
synced 2026-05-21 05:19:14 +00:00
UnmapWindow request
This commit is contained in:
parent
92016cdda8
commit
8e5758238f
2 changed files with 27 additions and 1 deletions
|
|
@ -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
21
test/map_unmap.js
Normal 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);
|
||||
|
||||
});
|
||||
Loading…
Reference in a new issue