mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-09 10:03:55 +00:00
commit
b2702100cb
@ -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)
|
||||
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user