From bcce2480130896ee68e740819d21ca802b25b3ba Mon Sep 17 00:00:00 2001 From: sbosse Date: Mon, 21 Jul 2025 23:03:22 +0200 Subject: [PATCH] Mon 21 Jul 22:43:21 CEST 2025 --- js/x11/core/ext/big-requests.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 js/x11/core/ext/big-requests.js diff --git a/js/x11/core/ext/big-requests.js b/js/x11/core/ext/big-requests.js new file mode 100644 index 0000000..8f91d3d --- /dev/null +++ b/js/x11/core/ext/big-requests.js @@ -0,0 +1,26 @@ +// http://www.x.org/releases/X11R7.6/doc/bigreqsproto/bigreq.html + +// TODO: move to templates +exports.requireExt = function(display, callback) +{ + var X = display.client; + X.QueryExtension('BIG-REQUESTS', function(err, ext) { + + if (!ext.present) + return callback(new Error('extension not available')); + + ext.Enable = function( cb ) + { + X.seq_num++; + X.pack_stream.pack('CCS', [ext.majorOpcode, 0, 1]); + X.replies[X.seq_num] = [ + function(buf, opt) { + return buf.unpack('L')[0]; + }, + cb + ]; + X.pack_stream.flush(); + } + callback(null, ext); + }); +}