Skip Menu |

This queue is for tickets about the X11-Protocol CPAN distribution.

Report information
The Basics
Id: 78664
Status: open
Priority: 0/
Queue: X11-Protocol

People
Owner: Nobody in particular
Requestors: NITO [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.56
Fixed in: (no value)



Subject: MacOSX Lion the display is set as type INET instead of unix with patch
In MacOSX Lion the display is set as type INET instead of Unix. How to reproduce echo $DISPLAY /tmp/launch-asdbas/x.org:0 In line 2270 of version 0.56 this turns out as host=tmp/launch-asdbas/x.org dispnum=0 This is the relevant patch (please review for sideeffects) --- /usr/lib/qvd/lib/perl5/site_perl/5.14.2/X11/Protocol.pm.orig 2012-07-30 13:12:39.000000000 +0200 +++ /usr/lib/qvd/lib/perl5/site_perl/5.14.2/X11/Protocol.pm 2012-07-30 13:26:08.000000000 +0200 @@ -2253,13 +2253,14 @@ } unless ($conn) { - $display =~ /^(?:[^:]*?\/)?(.*):(\d+)(?:.(\d+))?$/ + $display =~ /^(?:[^:]*?)?(.*):(\d+)(?:.(\d+))?$/ or croak "Invalid display: `$display'\n"; $host = $Default_Display unless $host = $1; $dispnum = $2; $screen = 0 unless $screen = $3; + print "$display\n$1\n$2\n$host\n"; if ($] >= 5.00301) { # IO::Socket is bundled - if ($host eq 'unix') { + if ($host eq 'unix' || $host =~ /^\//) { require 'X11/Protocol/Connection/UNIXSocket.pm'; $conn = X11::Protocol::Connection::UNIXSocket ->open($host, $dispnum);
I found the presented solution to be incomplete, as it does not work if you use another X server, like XQuartz. First file to be modified is UNIXSocket.pm, in order to make it use the $host variable which is passed to the function. Then Protocol.pm as shown in the attached diff.
Subject: UNIXSocket.pm.diff
--- /tmp/old.whatever 2013-02-11 19:31:33.000000000 +0100 +++ Protocol/Connection/UNIXSocket.pm 2013-02-11 19:31:48.000000000 +0100 @@ -21,8 +21,8 @@ my($pkg) = shift; my($host, $dispnum) = @_; my($sock) = IO::Socket::UNIX->new('Type' => SOCK_STREAM(), - 'Peer' => "/tmp/.X11-unix/X$dispnum"); - croak "Can't connect to display `unix:$dispnum': $!" unless $sock; + 'Peer' => "$host:$dispnum"); + croak "Can't connect to display `unix:/$host:$dispnum': $!" unless $sock; $sock->autoflush(0); return bless \$sock, $pkg; }
Subject: Protocol.pm.diff
--- /tmp/Protocol.pm 2013-02-11 19:32:53.000000000 +0100 +++ Protocol.pm 2013-02-11 19:24:56.000000000 +0100 @@ -2259,7 +2259,7 @@ $dispnum = $2; $screen = 0 unless $screen = $3; if ($] >= 5.00301) { # IO::Socket is bundled - if ($host eq 'unix') { + if ($host eq 'unix' || $host =~ /tmp\//) { require 'X11/Protocol/Connection/UNIXSocket.pm'; $conn = X11::Protocol::Connection::UNIXSocket ->open($host, $dispnum);
Please use this UNIXSocket.pm.diff instead of the first one posted. Sorry for mistake.
Subject: UNIXSocket.pm.diff
--- /tmp/old.whatever 2013-02-11 19:31:33.000000000 +0100 +++ Protocol/Connection/UNIXSocket.pm 2013-02-11 19:31:48.000000000 +0100 @@ -21,8 +21,8 @@ my($pkg) = shift; my($host, $dispnum) = @_; my($sock) = IO::Socket::UNIX->new('Type' => SOCK_STREAM(), - 'Peer' => "/tmp/.X11-unix/X$dispnum"); - croak "Can't connect to display `unix:$dispnum': $!" unless $sock; + 'Peer' => "/$host:$dispnum"); + croak "Can't connect to display `unix:/$host:$dispnum': $!" unless $sock; $sock->autoflush(0); return bless \$sock, $pkg; }