Skip to content

Commit

Permalink
Check for DISPLAY != NULL during scan_devices_xi2
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Aug 28, 2015
1 parent d59d6db commit 518317b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/mtview.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,11 @@ static int scan_devices_xi2(void)
int ndevices, i;
int deviceid = 0;

if (dpy == NULL) {
printf("Failed to open display\n");
return -1;
}

XIQueryVersion(dpy, &major, &minor);
if (major != 2 && minor < 2) {
printf("Unsupported XI2 version. Need 2.2 or newer, have %d.%d\n", major, minor);
Expand Down

0 comments on commit 518317b

Please sign in to comment.