directfb: Deal with Qt trying to create a QSize(0, 0) platfom window

Qt will attempt to create a platform window with the above size and
DirectFB will fail to create the window. Make sure the width/height
is at least 1 before handing it to DirectFB.

According to Samuel it is legitimate to create a QPlatformWindow  with
QSize(0, 0) and it is the job of the platform plugin to make it work.
Follow the approach of the XCB plugin and increase the size.

Change-Id: Ifc92780b46f1a73123945988d06bd21a3deb6bb0
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
bb10
Holger Hans Peter Freyther 2012-01-23 12:11:42 +01:00 committed by Qt by Nokia
parent cdb61839f4
commit 43696a9e42
1 changed files with 3 additions and 3 deletions

View File

@ -65,8 +65,8 @@ QDirectFbWindow::QDirectFbWindow(QWindow *tlw, QDirectFbInput *inputhandler)
|DWDESC_OPTIONS
#endif
|DWDESC_CAPS);
description.width = tlw->width();
description.height = tlw->height();
description.width = qMax(1, tlw->width());
description.height = qMax(1, tlw->height());
description.posx = tlw->x();
description.posy = tlw->y();
@ -213,4 +213,4 @@ IDirectFBSurface *QDirectFbWindow::dfbSurface()
return m_dfbSurface.data();
}
QT_END_NAMESPACE
QT_END_NAMESPACE