summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Xrandr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Xrandr.c b/src/Xrandr.c
index 8896675..c7bbc8e 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -395,9 +395,11 @@ int XRRUpdateConfiguration(XEvent *event)
if (event->type == ConfigureNotify) {
rcevent = (XConfigureEvent *) event;
snum = XRRRootToScreen(dpy, rcevent->window);
- dpy->screens[snum].width = rcevent->width;
- dpy->screens[snum].height = rcevent->height;
- return 1;
+ if (snum != -1) {
+ dpy->screens[snum].width = rcevent->width;
+ dpy->screens[snum].height = rcevent->height;
+ return 1;
+ }
}
info = XRRFindDisplay(dpy);