diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-06-01 10:37:30 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-06-01 11:01:32 +0200 |
commit | 646fcc1bd30ea9513b3d413f21677b2bbf947a4c (patch) | |
tree | 9ed6921a8e136c305242a1460de5647707244c86 /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | 38745b341c5c4d49fdb0e87f79f2714f105f63fe (diff) |
Do not choke on zero-sized windows.
Configure requests with zero width or height will always
fail with BadValue and have to be avoided. Same goes for
shm segments of size 0.
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index afcec8e139..d46e1407c7 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -285,7 +285,10 @@ void QXcbWindow::setGeometry(const QRect &rect) QPlatformWindow::setGeometry(rect); const quint32 mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; - const quint32 values[] = { rect.x(), rect.y(), rect.width(), rect.height() }; + const quint32 values[] = { rect.x(), + rect.y(), + qBound(1, rect.width(), XCOORD_MAX), + qBound(1, rect.height(), XCOORD_MAX) }; Q_XCB_CALL(xcb_configure_window(xcb_connection(), m_window, mask, values)); } |