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)
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);
203
pScreen = &pScreens[i-iSkippedScreens];
191
cd_warning ("This screen (%d) has no info, skip it.", i);
195
if (info->width == 0 || info->height == 0)
197
cd_debug ("This screen (%d) has a null dimensions, skip it.", i); // seems normal behaviour of xrandr, so no warning
198
XRRFreeCrtcInfo (info);
202
pScreen = &pScreens[iNbScreens];
204
203
pScreen->x = info->x;
205
204
pScreen->y = info->y;
206
205
pScreen->width = info->width;
207
206
pScreen->height = info->height;
208
cd_message (" * screen %d(%d-%d) => (%d;%d) %dx%d", iNbScreens, i, iSkippedScreens, pScreen->x, pScreen->y, pScreen->width, pScreen->height);
207
cd_message (" * screen %d(%d) => (%d;%d) %dx%d", iNbScreens, i, pScreen->x, pScreen->y, pScreen->width, pScreen->height);
210
209
XRRFreeCrtcInfo (info);