From 9db6c348df79729ebba5069ccd5e5cb960da4000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 10 Aug 2011 10:02:22 +0200 Subject: 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 Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/xcb/qxcbwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index b83f0123ad..f136b8167f 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -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(parent())->xcb_window(); -- cgit v1.2.3