mirror of
https://github.com/danbulant/node-x11
synced 2026-05-21 05:19:14 +00:00
extra fix for $DISPLAY parsing
This commit is contained in:
parent
e305b729f3
commit
f2f52d92f9
1 changed files with 6 additions and 14 deletions
|
|
@ -301,7 +301,7 @@ XClient.prototype.startHandshake = function()
|
|||
handshake.writeClientHello(this.pack_stream, this.displayNum, this.authHost);
|
||||
handshake.readServerHello(this.pack_stream, function(display)
|
||||
{
|
||||
// TODO: readServerHello can set erro state in display
|
||||
// TODO: readServerHello can set error state in display
|
||||
// emit error in that case
|
||||
client.expectReplyHeader();
|
||||
client.display = display;
|
||||
|
|
@ -316,17 +316,6 @@ XClient.prototype.require = function(extName, callback)
|
|||
ext.requireExt(this.display, callback);
|
||||
}
|
||||
|
||||
var platformLocalTransport = {
|
||||
win32: 'tcp',
|
||||
win64: 'tcp',
|
||||
cygwin: 'tcp',
|
||||
linux: 'unix',
|
||||
|
||||
// OSX
|
||||
darwin: 'unix'
|
||||
// TODO: check process.platform on SmartMachine solaris box
|
||||
}
|
||||
|
||||
module.exports.createClient = function(initCb, display)
|
||||
{
|
||||
if (!display)
|
||||
|
|
@ -349,11 +338,14 @@ module.exports.createClient = function(initCb, display)
|
|||
// open stream
|
||||
var stream;
|
||||
var socketPath;
|
||||
if ( process.platform.match(/win/).length > 0 )
|
||||
|
||||
// try local socket on non-windows platforms
|
||||
if ( ['cygwin', 'win32', 'win64'].indexOf(process.platform) < 0 )
|
||||
{
|
||||
if (process.platform == 'darwin')
|
||||
{
|
||||
if (display[0] == '/') // local socket
|
||||
// socket path on OSX is /tmp/launch-(some id)/org.x:0
|
||||
if (display[0] == '/')
|
||||
{
|
||||
socketPath = display;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue