Skip to content

Commit 2731045

Browse files
authored
Merge pull request #28 from nut-tree/feature/27/xgetmaindisplay
(#27) Modified XGetMainDisplay to default to $DISPLAY instead of ':0.0'
2 parents c782dfd + e6b959c commit 2731045

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/linux/xdisplay.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
static Display *mainDisplay = NULL;
77
static int registered = 0;
8-
static char *displayName = ":0.0";
8+
static char *displayName = NULL;
99
static int hasDisplayNameChanged = 0;
1010

1111
Display *XGetMainDisplay(void)
@@ -20,11 +20,6 @@ Display *XGetMainDisplay(void)
2020
/* First try the user set displayName */
2121
mainDisplay = XOpenDisplay(displayName);
2222

23-
/* Then try using environment variable DISPLAY */
24-
if (mainDisplay == NULL) {
25-
mainDisplay = XOpenDisplay(NULL);
26-
}
27-
2823
if (mainDisplay == NULL) {
2924
fputs("Could not open main display\n", stderr);
3025
} else if (!registered) {

0 commit comments

Comments
 (0)