From 5db57cfa340153a0c4863dada5ad6f7a3f68cefc Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 28 Jun 2013 14:07:31 +0000 Subject: [PATCH] Fixed handling of DISPLAY=127.0.0.1:2 usage. --- src/osg/GraphicsContext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osg/GraphicsContext.cpp b/src/osg/GraphicsContext.cpp index 2e6580f0e..c7c3e3944 100644 --- a/src/osg/GraphicsContext.cpp +++ b/src/osg/GraphicsContext.cpp @@ -113,8 +113,11 @@ void GraphicsContext::ScreenIdentifier::setScreenIdentifier(const std::string& d std::string::size_type colon = displayName.find_last_of(':'); std::string::size_type point = displayName.find_last_of('.'); + // handle the case where the host name is supplied with '.' such as 127.0.0.1:0 with only DisplayNum provided + // here the point to picks up on the .1 from the host name, rather then demarking the DisplayNum/ScreenNum as + // no ScreenNum is provided, hence no . in the rhs of the : if (point!=std::string::npos && - colon==std::string::npos && + colon!=std::string::npos && point < colon) point = std::string::npos; if (colon==std::string::npos)