Bug 712291 - broken window resizing on qt/maemo/meego. r=romaxa

This commit is contained in:
Florian Haenel 2011-12-22 23:13:53 -05:00
Родитель d09c93a686
Коммит 3be1cc2236
2 изменённых файлов: 15 добавлений и 4 удалений

Просмотреть файл

@ -93,6 +93,9 @@ nsScreenQt::GetRect(PRInt32 *outLeft,PRInt32 *outTop,
QRect r = QApplication::desktop()->screenGeometry(mScreen);
#ifdef MOZ_ENABLE_QTMOBILITY
r = MozQOrientationSensorFilter::GetRotationTransform().mapRect(r);
// just rotating gives us weird negative coordinates, but we want to return
// sensible logical coordinates
r.moveTo(0, 0);
#endif
*outTop = r.x();

Просмотреть файл

@ -2382,9 +2382,13 @@ nsWindow::NativeResize(PRInt32 aWidth, PRInt32 aHeight, bool aRepaint)
mNeedsResize = false;
if (mIsTopLevel) {
QWidget *widget = GetViewWidget();
QGraphicsView *widget = qobject_cast<QGraphicsView*>(GetViewWidget());
NS_ENSURE_TRUE(widget,);
widget->resize(aWidth, aHeight);
// map from in-scene widget to scene, from scene to view.
QRect r = widget->mapFromScene(mWidget->mapToScene(QRect(0, 0, aWidth, aHeight))).boundingRect();
// going from QPolygon to QRect includes the points, adding one to width and height
r.adjust(0, 0, -1, -1);
widget->resize(r.width(), r.height());
}
else {
mWidget->resize(aWidth, aHeight);
@ -2406,9 +2410,13 @@ nsWindow::NativeResize(PRInt32 aX, PRInt32 aY,
mNeedsMove = false;
if (mIsTopLevel) {
QWidget *widget = GetViewWidget();
QGraphicsView *widget = qobject_cast<QGraphicsView*>(GetViewWidget());
NS_ENSURE_TRUE(widget,);
widget->setGeometry(aX, aY, aWidth, aHeight);
// map from in-scene widget to scene, from scene to view.
QRect r = widget->mapFromScene(mWidget->mapToScene(QRect(aX, aY, aWidth, aHeight))).boundingRect();
// going from QPolygon to QRect includes the points, adding one to width and height
r.adjust(0, 0, -1, -1);
widget->setGeometry(r.x(), r.y(), r.width(), r.height());
}
else {
mWidget->setGeometry(aX, aY, aWidth, aHeight);