X11: Workaround DISPLAY not being set.

This commit is contained in:
Бранимир Караџић 2024-05-25 09:10:05 -07:00
parent 87fd766c33
commit da5f27f9ce

View File

@ -335,10 +335,15 @@ namespace entry
m_display = XOpenDisplay(NULL);
if (NULL == m_display)
{
// Use `DISPLAY` enviroment variable to pick display. If `DISPLAY` is not set try ":0"
m_display = XOpenDisplay(":0");
if (NULL == m_display)
{
bx::printf("XOpenDisplay failed: DISPLAY environment variable must be set.\n\n");
return bx::kExitFailure;
}
}
int32_t screen = DefaultScreen(m_display);
m_depth = DefaultDepth(m_display, screen);