Skip to content

Commit

Permalink
X11: Workaround DISPLAY not being set.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed May 25, 2024
1 parent 87fd766 commit da5f27f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/common/entry/entry_x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,13 @@ namespace entry
m_display = XOpenDisplay(NULL);
if (NULL == m_display)
{
bx::printf("XOpenDisplay failed: DISPLAY environment variable must be set.\n\n");
return bx::kExitFailure;
// 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);
Expand Down

0 comments on commit da5f27f

Please sign in to comment.