Prevent X errors being generated when setting 0 as width or height.

Change-Id: I38b12471f2c327952c4b5f6acb01c1f1ef53da28
Reviewed-on: http://codereview.qt.nokia.com/2823
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
This commit is contained in:
Samuel Rødal 2011-08-10 10:02:22 +02:00 committed by Paul Olav Tvete
parent cea41dc093
commit 9db6c348df

View File

@ -154,6 +154,9 @@ void QXcbWindow::create()
QRect rect = window()->geometry();
QPlatformWindow::setGeometry(rect);
rect.setWidth(qBound(1, rect.width(), XCOORD_MAX));
rect.setHeight(qBound(1, rect.height(), XCOORD_MAX));
xcb_window_t xcb_parent_id = m_screen->root();
if (parent())
xcb_parent_id = static_cast<QXcbWindow *>(parent())->xcb_window();