Commit dbde2b20 authored by Julien Cristau's avatar Julien Cristau Committed by Alan Coopersmith
Browse files

Be more careful about querying randr

Check for extension version and number of outputs:
XRRGetScreenResourcesCurrent was added in v1.3.  Also, there's no
guarantee it returns any outputs, and we don't want to die with a
BadRROutput error.
parent 818582b4
Pipeline #569218 passed with stages
in 1 minute and 33 seconds
......@@ -1090,9 +1090,12 @@ is_xwayland(void)
/* e.g. Xnest, but definitely not Xwayland */
goto out;
}
if (major < 1 || (major == 1 && minor < 3)) {
goto out;
}
resources = XRRGetScreenResourcesCurrent(dpy, DefaultRootWindow(dpy));
if (!resources) {
if (!resources || resources->noutput < 1) {
goto out;
}
......
Supports Markdown
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