Desktop Dual Screen in Ubuntu 10.04, get screen width and height not coherent.
I'm using official nvidia drivers with twin view and I noticed sizes are not right.
Code:
int w0 = desktop.screen(0)->width();
int h0 = desktop.screen(0)->height();
int w1 = desktop.screen(1)->width();
int h1 = desktop.screen(1)->height();
std::cout << desktop.numScreens() << std::endl;
std::cout << w0 << " : " << h0 << std::endl;
std::cout << w1 << " : " << h1 << std::endl;
output:
2
3600 : 1200
3600 : 1200
My monitor configuration is 1920 1200 and 1680 1050. Obviously the sizes are merged. Is this a normal behavior? How can I get independent sizes?
This is somewhat of a problem since I wanted to fit the window in the center on the first screen...
Thanks
Re: Desktop Dual Screen in Ubuntu 10.04, get screen width and height not coherent.
This works for me and I'm using dual monitors.
Code:
#include <QtCore/QtCore>
#include <QtGui/QtGui>
int main(int argc, char** argv)
{
for (int i = 0; i < desktop.screenCount(); ++i) {
qDebug() << "Width: " << desktop.screenGeometry(i).width();
qDebug() << "Height: " << desktop.screenGeometry(i).height();
}
}
Re: Desktop Dual Screen in Ubuntu 10.04, get screen width and height not coherent.
Right on the spot. Thanks.