sidorares/node-x11

Window Manager not working

RossComputerGuy opened this issue · 9 comments

I get this error from the window manager example:

{ Error: XRender: a value for a PICTURE argument does not name a defined PICTURE
    at ReadFixedRequest.callback (/home/spaceboyross/Documents/PeabodyWM/node_modules/x11/lib/xcore.js:465:29)
    at ReadFixedRequest.execute (/home/spaceboyross/Documents/PeabodyWM/node_modules/x11/lib/unpackstream.js:41:10)
    at UnpackStream.resume (/home/spaceboyross/Documents/PeabodyWM/node_modules/x11/lib/unpackstream.js:165:30)
    at UnpackStream.write (/home/spaceboyross/Documents/PeabodyWM/node_modules/x11/lib/unpackstream.js:102:10)
    at Socket.<anonymous> (/home/spaceboyross/Documents/PeabodyWM/node_modules/x11/lib/xcore.js:88:21)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:561:20)
  error: 143,
  seq: 6,
  message: 'XRender: a value for a PICTURE argument does not name a defined PICTURE',
  badParam: 377,
  minorOpcode: 8,
  majorOpcode: 139 }

Is this using unmodified wm example?

I've found out that ChangeWindowAttributes doesn't fully call the callback.

I've found out that ChangeWindowAttributes doesn't fully call the callback.

can you give more details on this?

It only calls the callback WHEN an error occurs, I've never been able to have a callback execute when there is no error.

afaik this is generic problem and I don't know good solution

Because of the way protocol is optimised for latency you generate id on the client, then submit request using this id most requests don't need to return anything and only return errors. There is no way to tell if /when request completed

The only thing protocol guarantees is if you have request A and then request B they performed in order on server

Probably callback style is bad api for this, maybe we should return EventEmitter from every request

Most requests never return anything and only get response when there is error ( CreateWindow, ChangeWindowAttributes )

Some always return data or error exactly once ( GetWindowAttributes, GetAtomName, GetProperty)

Some call callback one or more times ( ListFontsWithInfo:

This request is similar to ListFonts, but it also returns information about
each font. The information returned for each font is identical to what
QueryFont would return except that the per-character metrics are not returned.
Note that this request can generate multiple replies. With each reply,
replies-hint may provide an indication of how many more fonts will be returned.
This number is a hint only and may be larger or smaller than the number of
fonts actually returned. A zero value does not guarantee that no more fonts
will be returned. After the font replies, a reply with a zero-length name is
sent to indicate the end of the reply sequence.
)

An event emitter would make more sense an would be easier to implement.