Lines 407-442
Link Here
|
407 |
monitor *m = (monitor *) calloc (1, sizeof (monitor)); |
407 |
monitor *m = (monitor *) calloc (1, sizeof (monitor)); |
408 |
XRROutputInfo *rroi = XRRGetOutputInfo (dpy, res, |
408 |
XRROutputInfo *rroi = XRRGetOutputInfo (dpy, res, |
409 |
res->outputs[k]); |
409 |
res->outputs[k]); |
410 |
RRCrtc crtc = (rroi->crtc ? rroi->crtc : rroi->crtcs[0]); |
|
|
411 |
XRRCrtcInfo *crtci = XRRGetCrtcInfo (dpy, res, crtc); |
412 |
|
410 |
|
413 |
monitors[j] = m; |
411 |
monitors[j] = m; |
414 |
m->screen = screen; |
412 |
m->screen = screen; |
415 |
m->id = (i * 1000) + j; |
413 |
m->id = (i * 1000) + j; |
416 |
m->desc = (rroi->name ? strdup (rroi->name) : 0); |
414 |
m->desc = (rroi->name ? strdup (rroi->name) : 0); |
417 |
m->x = crtci->x; |
|
|
418 |
m->y = crtci->y; |
419 |
|
415 |
|
420 |
if (crtci->rotation & (RR_Rotate_90|RR_Rotate_270)) |
416 |
if (rroi->connection == RR_Disconnected || |
|
|
417 |
(rroi->crtc == 0 && rroi->ncrtc == 0)) |
421 |
{ |
418 |
{ |
422 |
m->width = crtci->height; |
419 |
m->sanity = S_DISABLED; |
423 |
m->height = crtci->width; |
|
|
424 |
} |
420 |
} |
|
|
421 |
/* #### do the same for RR_UnknownConnection? */ |
425 |
else |
422 |
else |
426 |
{ |
423 |
{ |
427 |
m->width = crtci->width; |
424 |
RRCrtc crtc = (rroi->crtc ? rroi->crtc : rroi->crtcs[0]); |
428 |
m->height = crtci->height; |
425 |
XRRCrtcInfo *crtci = XRRGetCrtcInfo (dpy, res, crtc); |
|
|
426 |
|
427 |
m->x = crtci->x; |
428 |
m->y = crtci->y; |
429 |
|
430 |
if (crtci->rotation & (RR_Rotate_90|RR_Rotate_270)) |
431 |
{ |
432 |
m->width = crtci->height; |
433 |
m->height = crtci->width; |
434 |
} |
435 |
else |
436 |
{ |
437 |
m->width = crtci->width; |
438 |
m->height = crtci->height; |
439 |
} |
440 |
|
441 |
XRRFreeCrtcInfo (crtci); |
429 |
} |
442 |
} |
430 |
|
443 |
|
431 |
j++; |
444 |
j++; |
432 |
|
445 |
|
433 |
if (rroi->connection == RR_Disconnected) |
|
|
434 |
m->sanity = S_DISABLED; |
435 |
/* #### do the same for RR_UnknownConnection? */ |
436 |
|
437 |
XRRFreeCrtcInfo (crtci); |
438 |
XRRFreeOutputInfo (rroi); |
446 |
XRRFreeOutputInfo (rroi); |
439 |
} |
447 |
} |
|
|
448 |
|
440 |
XRRFreeScreenResources (res); |
449 |
XRRFreeScreenResources (res); |
441 |
# endif /* HAVE_RANDR_12 */ |
450 |
# endif /* HAVE_RANDR_12 */ |
442 |
} |
451 |
} |