diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2010-08-15 22:46:45 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2010-08-15 22:46:45 -0700 |
commit | 75efd6946ed1096590cb964f7e0daa4484d2020a (patch) | |
tree | b0c657b0f60a583786cf931abd92b0a749fef794 | |
parent | 0ad57ba345bd4c0a50d9bb72dfaef0d304805b71 (diff) |
xts-config.in: ":n" is a valid display name
When determining whether the connection is local and you can connect to the
server via TCP, don't try to parse out ":n.m" and then reconstruct it as
"hostname:n.m", because ":n" is a valid display name. Instead, check for the
optional ".m" part and if it matches, just tack the complete $DISPLAY value
(including the leading colon) onto the hostname.
Fixes XOpenDisplay-10 when $DISPLAY is missing the optional screen number part.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
-rwxr-xr-x | xts5/bin/xts-config.in | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/xts5/bin/xts-config.in b/xts5/bin/xts-config.in index 4a11a398..4d00510c 100755 --- a/xts5/bin/xts-config.in +++ b/xts5/bin/xts-config.in @@ -75,14 +75,14 @@ BEGIN $::vars{"XT_VISUAL_CLASSES"} = join ' ', keys %visuals; - if($::vars{"DISPLAY"} =~ /^:(\d+)\.(\d+)$/) + if($::vars{"DISPLAY"} =~ /^:\d+(\.\d+)?$/) { $::vars{"XT_LOCAL"} = "Yes"; my $hostname = hostname(); # have xdpyinfo try connecting to the same display via TCP; # just check its exit status. - $ENV{"DISPLAY"} = "$hostname:$1.$2"; + $ENV{"DISPLAY"} = $hostname . $::vars{"DISPLAY"}; open(INFO, "$xset q 2>/dev/null |") or die "$xset q on TCP failed, giving up.\n"; <INFO>; # discard output close(INFO); |