Reputation: 31
I wrote an application using C++/Qt and libxrandr library to change the resolution and orientation of monitor. But I must extend the functionality. Help me please understand how to do the following:
Upvotes: 1
Views: 1886
Reputation: 31
problem solved
XRROutputInfo *output_first_info = XRRGetOutputInfo(dpy, sr, sr->outputs[X]);
XRRSetCrtcConfig(dpy, sr, output_first_info->crtc, CurrentTime, XM, YM, sr->modes[M].id, R, &sr->outputs[X], 1);
where X - number of monitor to configure XM, YM - coordinates in virtual screen M - number of mode
get list of modes for connected monitors:
int jj = 0;
for (int i = 0; i < sr->noutput; i++)
{
XRROutputInfo *output_info = XRRGetOutputInfo (dpy, sr, sr->outputs[i]);
XRRCrtcInfo *crtc_info = XRRGetCrtcInfo(dpy, sr, output_info->crtc);
for (int j = jj; j < output_info->nmode; j++)
{
qDebug() << output_info->name << sr->modes[j].name << j;
jj++;
}
}
Upvotes: 2