Prevent X errors being generated when setting 0 as width or height.
authorSamuel Rødal <samuel.rodal@nokia.com>
Wed, 10 Aug 2011 08:02:22 +0000 (10:02 +0200)
committerPaul Olav Tvete <paul.tvete@nokia.com>
Fri, 19 Aug 2011 09:39:42 +0000 (11:39 +0200)
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>
src/plugins/platforms/xcb/qxcbwindow.cpp

index b83f012..f136b81 100644 (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();