summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Xrandr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Xrandr.c b/src/Xrandr.c
index b1e97ec..a9fba87 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -483,6 +483,9 @@ int XRRUpdateConfiguration(XEvent *event)
scevent = (XRRScreenChangeNotifyEvent *) event;
snum = XRRRootToScreen(dpy,
((XRRScreenChangeNotifyEvent *) event)->root);
+ if (snum < 0)
+ return 0;
+
if (scevent->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
dpy->screens[snum].width = scevent->height;
dpy->screens[snum].height = scevent->width;