diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-05-31 09:26:55 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2011-05-31 09:59:55 +0200 |
commit | be24744c75e21aa96f94f162cfce12218776e3ec (patch) | |
tree | 0ff6da2ef603feaa00c4f1bda497d7a7c0c6b46b /src/plugins/platforms/xcb | |
parent | 0909a0bbfbf6de90a79e5c076b0330e99a9a9a93 (diff) |
Set xcb size hints properly avoid strange behaviour.
Strange behaviour means incorrect dialog sizes, inability to resize,
X crashes, etc. These were caused by not properly filling the size
hint structure, leaving possibly random garbage in it.
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 1460d7ea81..e17c87fa85 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -73,6 +73,8 @@ #include "../eglconvenience/qxlibeglintegration.h" #endif +#define XCOORD_MAX 16383 + //#ifdef NET_WM_STATE_DEBUG // Returns true if we should set WM_TRANSIENT_FOR on \a w @@ -840,6 +842,7 @@ void QXcbWindow::propagateSizeHints() { // update WM_NORMAL_HINTS xcb_size_hints_t hints; + memset(&hints, 0, sizeof(hints)); QRect rect = geometry(); @@ -857,7 +860,9 @@ void QXcbWindow::propagateSizeHints() xcb_size_hints_set_min_size(&hints, minimumSize.width(), minimumSize.height()); if (maximumSize.width() < QWINDOWSIZE_MAX || maximumSize.height() < QWINDOWSIZE_MAX) - xcb_size_hints_set_max_size(&hints, maximumSize.width(), maximumSize.height()); + xcb_size_hints_set_max_size(&hints, + qMin(XCOORD_MAX, maximumSize.width()), + qMin(XCOORD_MAX, maximumSize.height())); if (sizeIncrement.width() > 0 || sizeIncrement.height() > 0) { xcb_size_hints_set_base_size(&hints, baseSize.width(), baseSize.height()); |