now using ":0.0" as the display if DISPLAY isn't set.

This commit is contained in:
crs 2002-06-09 18:03:32 +00:00
parent e94be94a50
commit db8165db09
1 changed files with 8 additions and 2 deletions

View File

@ -42,9 +42,15 @@ void CXWindowsScreen::openDisplay()
// set the X I/O error handler so we catch the display disconnecting // set the X I/O error handler so we catch the display disconnecting
XSetIOErrorHandler(&CXWindowsScreen::ioErrorHandler); XSetIOErrorHandler(&CXWindowsScreen::ioErrorHandler);
// get the DISPLAY
const char* display = getenv("DISPLAY");
if (display == NULL) {
display = ":0.0";
}
// open the display // open the display
log((CLOG_DEBUG "XOpenDisplay(%s)", "NULL")); log((CLOG_DEBUG "XOpenDisplay(\"%s\")", display));
m_display = XOpenDisplay(NULL); // FIXME -- allow non-default m_display = XOpenDisplay(display);
if (m_display == NULL) if (m_display == NULL)
throw XScreenOpenFailure(); throw XScreenOpenFailure();