int j = 0;
/* get any outputs on this crtc */
- outputs =
- ecore_x_randr_crtc_outputs_get(root, crtcs[i], &noutputs);
-
- /* if this crtc has no outputs, we can use it */
- if ((!outputs) || (noutputs == 0))
+ if (!(outputs =
+ ecore_x_randr_crtc_outputs_get(root, crtcs[i], &noutputs)))
+ ret = crtcs[i];
+ else if (noutputs == 0)
ret = crtcs[i];
else
{
}
}
+ free(outputs);
if (ret) break;
}
root = ecore_x_window_root_first_get();
- modes = ecore_x_randr_output_modes_get(root, output, &n, &p);
- if ((!modes) || (n == 0)) return;
+ if (!(modes = ecore_x_randr_output_modes_get(root, output, &n, &p)))
+ return;
+
+ if (n == 0)
+ {
+ if (modes) free(modes);
+ return;
+ }
ecore_x_randr_mode_size_get(root, modes[p - 1], mw, mh);
int j = 0;
/* get any outputs on this crtc */
- outputs =
- ecore_x_randr_crtc_outputs_get(root, crtcs[i], &noutputs);
-
- /* if this crtc has no outputs, we can use it */
- if ((!outputs) || (noutputs == 0))
+ if (!(outputs =
+ ecore_x_randr_crtc_outputs_get(root, crtcs[i], &noutputs)))
+ ret = crtcs[i];
+ else if (noutputs == 0)
ret = crtcs[i];
else
{
}
}
+ free(outputs);
if (ret) break;
}