sidorares/node-x11

Getting error on running wm example

Closed this issue · 2 comments

Hi. I'm getting an error running the wm example.

tom@laptom ~/Documents/Code9/window-manager
2014-15-24 18:15:27 ⚡ DISPLAY=:1 node foo.js 

/home/tom/Documents/Code9/window-manager/node_modules/x11/lib/ext/render.js:17
            display.client.seq2stack[display.client.seq_num] = err.stack;
                                                             ^
TypeError: Cannot set property '4' of undefined
    at captureStack (/home/tom/Documents/Code9/window-manager/node_modules/x11/lib/ext/render.js:17:62)
    at Object.ext.QueryPictFormat (/home/tom/Documents/Code9/window-manager/node_modules/x11/lib/ext/render.js:46:17)
    at /home/tom/Documents/Code9/window-manager/node_modules/x11/lib/ext/render.js:373:17
    at ReadFixedRequest.callback (/home/tom/Documents/Code9/window-manager/node_modules/x11/lib/xcore.js:493:21)
    at ReadFixedRequest.execute (/home/tom/Documents/Code9/window-manager/node_modules/x11/lib/unpackstream.js:41:10)
    at UnpackStream.resume (/home/tom/Documents/Code9/window-manager/node_modules/x11/lib/unpackstream.js:165:30)
    at UnpackStream.write (/home/tom/Documents/Code9/window-manager/node_modules/x11/lib/unpackstream.js:102:10)
    at Socket.<anonymous> (/home/tom/Documents/Code9/window-manager/node_modules/x11/lib/xcore.js:58:21)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:745:14)

tom@laptom ~/Documents/Code9/window-manager
2014-15-24 18:15:34 ⚡ 

I see this in the Xephyr output:

tom@laptom ~
2014-08-24 18:08:17 ⚡ Xephyr -screen 800x600 -nodri -br :1
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
2 XSELINUXs still allocated at resetutExtension
SCREEN: 0 objects of 256 bytes = 0 total bytes 0 private allocs
DEVICE: 0 objects of 32 bytes = 0 total bytes 0 private allocs
CLIENT: 0 objects of 168 bytes = 0 total bytes 0 private allocs
WINDOW: 0 objects of 56 bytes = 0 total bytes 0 private allocs
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 0 objects of 16 bytes = 0 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 2 objects, 24 bytes, 0 allocs
1 PIXMAPs still allocated at reset
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 0 objects of 16 bytes = 0 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 2 objects, 24 bytes, 0 allocs
1 CURSORs still allocated at reset
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 1 objects, 8 bytes, 0 allocs
1 CURSOR_BITSs still allocated at reset
TOTAL: 0 objects, 0 bytes, 0 allocs
1 DAMAGEs still allocated at reset
TOTAL: 0 objects, 0 bytes, 0 allocs
2 XSELINUXs still allocated at reset
SCREEN: 0 objects of 256 bytes = 0 total bytes 0 private allocs
DEVICE: 0 objects of 32 bytes = 0 total bytes 0 private allocs
CLIENT: 0 objects of 168 bytes = 0 total bytes 0 private allocs
WINDOW: 0 objects of 56 bytes = 0 total bytes 0 private allocs
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 0 objects of 16 bytes = 0 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 2 objects, 24 bytes, 0 allocs
1 PIXMAPs still allocated at reset
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 0 objects of 16 bytes = 0 total bytes 0 private allocs
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 2 objects, 24 bytes, 0 allocs
1 CURSORs still allocated at reset
CURSOR: 1 objects of 8 bytes = 8 total bytes 0 private allocs
TOTAL: 1 objects, 8 bytes, 0 allocs
1 CURSOR_BITSs still allocated at reset
TOTAL: 0 objects, 0 bytes, 0 allocs
1 DAMAGEs still allocated at reset
TOTAL: 0 objects, 0 bytes, 0 allocs

It's happening to me too. For the moment you can avoid the problem by creating the client in wm.js with the debug option set.

diff --git a/examples/windowmanager/wm.js b/examples/windowmanager/wm.js
index dcaebdd..bce3dc2 100644
--- a/examples/windowmanager/wm.js
+++ b/examples/windowmanager/wm.js
@@ -78,7 +78,7 @@ function ManageWindow(wid)
     });
 }

-x11.createClient(function(err, display) {
+x11.createClient({ debug : true }, function(err, display) {
     X = display.client;
     X.require('render', function(Render) {
     X.Render = Render;

@sidorares Should we check for the debug option before calling captureStack in the render and shape extensions?

Hi! Should be fixed now with #61