summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2010-08-15 22:46:45 -0700
committerAaron Plattner <aplattner@nvidia.com>2010-08-17 17:43:57 -0700
commit02b6638f05d94ca908fd3d65551bc0bc4a2ab592 (patch)
treeb0c657b0f60a583786cf931abd92b0a749fef794
parent852097ea00c6459625f4097df2337f72b43e1c7d (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> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rwxr-xr-xxts5/bin/xts-config.in4
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);