Commit 4e4bbb85 authored by Pauli Nieminen's avatar Pauli Nieminen Committed by Alan Coopersmith

XRRUpdateConfiguration: Check if getting screen for root fails

XRRRootToScreen might return -1 if it fails to find screen for the root
window.  Following code uses screen number unconditionally to index the
screen array.
Signed-off-by: default avatarPauli Nieminen <ext-pauli.nieminen@nokia.com>
Reviewed-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
parent 9e4abe74
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment