mirror of
https://github.com/danbulant/node-x11
synced 2026-05-22 13:59:11 +00:00
Merge pull request #56 from santigimeno/more_RANDR
Add GetCrtcInfo and fix in GetScreenResources
This commit is contained in:
commit
0e49f39d65
1 changed files with 33 additions and 1 deletions
|
|
@ -179,7 +179,7 @@ exports.requireExt = function(display, callback)
|
|||
format = Array(res[4] + 1).join('LSSLSSSSSSSSL');
|
||||
res_modes = buf.unpack(format, pos);
|
||||
pos += res[4] << 5;
|
||||
for (i = 0; i < res_modes[4]; i+= 13) {
|
||||
for (i = 0; i < res[4]; i+= 13) {
|
||||
resources.modeinfos.push({
|
||||
id : res_modes[i + 0],
|
||||
width : res_modes[i + 1],
|
||||
|
|
@ -207,6 +207,38 @@ exports.requireExt = function(display, callback)
|
|||
X.pack_stream.flush();
|
||||
},
|
||||
|
||||
ext.GetCrtcInfo = function(crtc, configTs, cb) {
|
||||
X.seq_num ++;
|
||||
X.pack_stream.pack('CCSLL', [ext.majorOpcode, 20, 3, crtc, configTs ]);
|
||||
X.replies[X.seq_num] = [
|
||||
function(buf, opt) {
|
||||
var pos = 0;
|
||||
var res = buf.unpack('LssSSLSSSS');
|
||||
var info = {
|
||||
status : opt,
|
||||
timestamp : res[0],
|
||||
x : res[1],
|
||||
y : res[2],
|
||||
width : res[3],
|
||||
height : res[4],
|
||||
mode : res[5],
|
||||
rotation : res[6],
|
||||
rotations : res[7]
|
||||
};
|
||||
|
||||
pos += 24;
|
||||
var format = Array(res[8] + 1).join('L');
|
||||
info.output = buf.unpack(format, pos);
|
||||
format = Array(res[9] + 1).join('L');
|
||||
info.possible = buf.unpack(format, pos);
|
||||
return info;
|
||||
},
|
||||
cb
|
||||
];
|
||||
|
||||
X.pack_stream.flush();
|
||||
},
|
||||
|
||||
X.eventParsers[ext.firstEvent + ext.events.RRScreenChangeNotify] = function(type, seq, extra, code, raw)
|
||||
{
|
||||
var event = {};
|
||||
|
|
|
|||
Loading…
Reference in a new issue