free(index_data);
}
-int initialize_monitor(Compositor *compositor, CompositedScreen *screen, CompositedMonitor *monitor, XRRScreenResources *xrr_res, unsigned index)
+int initialize_monitor(Compositor *compositor, CompositedScreen *screen, XRRScreenResources *xrr_res, unsigned index)
{
+ CompositedMonitor *monitor;
XRROutputInfo *output;
XRRCrtcInfo *crtc;
unsigned buffers[2];
unsigned stride;
+ monitor = &screen->monitors[index];
+
output = XRRGetOutputInfo(compositor->display, xrr_res, xrr_res->outputs[index]);
monitor->enabled = !!output->crtc;
if(!monitor->enabled)
screen->nmonitors = xrr_res->noutput;
screen->monitors = (CompositedMonitor *)malloc(screen->nmonitors*sizeof(CompositedMonitor));
for(i=0; i<screen->nmonitors; ++i)
- if(!initialize_monitor(compositor, screen, &screen->monitors[i], xrr_res, i))
+ if(!initialize_monitor(compositor, screen, xrr_res, i))
return 0;
XRRFreeScreenResources(xrr_res);