now using ":0.0" as the display if DISPLAY isn't set.
This commit is contained in:
parent
e94be94a50
commit
db8165db09
|
@ -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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue