mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
respect DISPLAY on linux
Signed-off-by: Arvid E. Picciani <aep@exys.org>
This commit is contained in:
parent
fbaf36442c
commit
47245e8862
@ -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