182
182
int n = res->ncrtc;
183
183
cd_debug (" number of screen(s): %d", n);
184
184
pScreens = g_new0 (GtkAllocation, n);
185
int i, iSkippedScreens = 0;
186
186
for (i = 0; i < n; i++)
188
188
XRRCrtcInfo *info = XRRGetCrtcInfo (s_XDisplay, res, res->crtcs[i]);
189
if (info == NULL || info->width == 0 || info->height == 0)
191
cd_warning ("This screen (%d) has no info, skip it.", i);
192
cd_warning ("This screen (%d) has no info, skip it.", i);
195
cd_message ("This screen (%d) has a null dimensions, skip it.", i); // it's "normal"
196
XRRFreeCrtcInfo (info);
198
iSkippedScreens++; // we have to skip this screen and reduce pScreens
199
pScreens = g_renew (GtkAllocation, pScreens, n - iSkippedScreens);
195
if (info->width == 0 || info->height == 0)
197
cd_message ("This screen (%d) has a null dimensions, skip it.", i);
198
XRRFreeCrtcInfo (info);
199
continue; // if that happens, does it screw the number of screens ?...
202
pScreen = &pScreens[i];
203
pScreen = &pScreens[i-iSkippedScreens];
203
204
pScreen->x = info->x;
204
205
pScreen->y = info->y;
205
206
pScreen->width = info->width;
206
207
pScreen->height = info->height;
207
cd_message (" * screen %d(%d) => (%d;%d) %dx%d", iNbScreens, i, pScreen->x, pScreen->y, pScreen->width, pScreen->height);
208
cd_message (" * screen %d(%d-%d) => (%d;%d) %dx%d", iNbScreens, i, iSkippedScreens, pScreen->x, pScreen->y, pScreen->width, pScreen->height);
209
210
XRRFreeCrtcInfo (info);