diff --git a/src/Xrandr.c b/src/Xrandr.c index b1e97ec..85d30bc 100644 --- a/src/Xrandr.c +++ b/src/Xrandr.c @@ -483,6 +483,11 @@ int XRRUpdateConfiguration(XEvent *event) scevent = (XRRScreenChangeNotifyEvent *) event; snum = XRRRootToScreen(dpy, ((XRRScreenChangeNotifyEvent *) event)->root); + /* check for return value, fails on nx. + https://bugs.launchpad.net/ubuntu-advantage/+bug/1084793*/ + if (snum == -1 ) { + return 0; + } if (scevent->rotation & (RR_Rotate_90 | RR_Rotate_270)) { dpy->screens[snum].width = scevent->height; dpy->screens[snum].height = scevent->width;