From db8165db09c00da1abed9907cef691c60a2d78de Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 9 Jun 2002 18:03:32 +0000 Subject: [PATCH] now using ":0.0" as the display if DISPLAY isn't set. --- platform/CXWindowsScreen.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/CXWindowsScreen.cpp b/platform/CXWindowsScreen.cpp index d2817c95..adbc5193 100644 --- a/platform/CXWindowsScreen.cpp +++ b/platform/CXWindowsScreen.cpp @@ -42,9 +42,15 @@ void CXWindowsScreen::openDisplay() // set the X I/O error handler so we catch the display disconnecting XSetIOErrorHandler(&CXWindowsScreen::ioErrorHandler); + // get the DISPLAY + const char* display = getenv("DISPLAY"); + if (display == NULL) { + display = ":0.0"; + } + // open the display - log((CLOG_DEBUG "XOpenDisplay(%s)", "NULL")); - m_display = XOpenDisplay(NULL); // FIXME -- allow non-default + log((CLOG_DEBUG "XOpenDisplay(\"%s\")", display)); + m_display = XOpenDisplay(display); if (m_display == NULL) throw XScreenOpenFailure();