Skip to content

Commit

Permalink
Merge pull request #56 from aep/master
Browse files Browse the repository at this point in the history
respect DISPLAY on linux
  • Loading branch information
vcaesar authored Dec 31, 2021
2 parents 25c764c + 47245e8 commit b270210
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion base/xdisplay_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

static Display *mainDisplay = NULL;
static int registered = 0;
static char *displayName = ":0.0";
static char *displayName = NULL;
static int hasDisplayNameChanged = 0;

Display *XGetMainDisplay(void)
Expand All @@ -24,6 +24,11 @@ Display *XGetMainDisplay(void)
mainDisplay = XOpenDisplay(NULL);
}

/* Fall back to the most likely :0.0*/
if (mainDisplay == NULL) {
mainDisplay = XOpenDisplay(":0.0");
}

if (mainDisplay == NULL) {
fputs("Could not open main display\n", stderr);
} else if (!registered) {
Expand Down

0 comments on commit b270210

Please sign in to comment.