set geometry property in QXcbWindow after checking minimum size
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sun, 3 Mar 2024 09:03:16 +0000 (09:03 +0000)
committerSteve Langasek <vorlon@debian.org>
Sun, 3 Mar 2024 09:03:16 +0000 (09:03 +0000)
commitdfe1b7bcd191325d7ea155168f210a7d0998a6ad
tree14fa7b30fb73417ad1b3967c7fd378f97f105503
parent068ab0dc418d39e22a5cff8a72a302eae4c5c2fc
set geometry property in QXcbWindow after checking minimum size

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=6a3627b6c5aa5109
Last-Update: 2023-01-04

QXcbWindow::create() bound the window's size to windowMinimumSize(),
after its size had been inherited from parent().
QPlatformWindow::setGeometry() was called before that sanity check.

When a fullscreen window is re-mapped from a deactivated screen to the
remaining screen, the call to QPlatformWindow::setGeometry() assigns
an invalid QRect to QPlatformWindowPrivate::rect
The negative int values x2 and/or y2 cause
QXcbBackingStoreImage::flushPixmap to address unmapped memory and
crash.

This patch moves the call to QPlatformWindow::setGeometry() from
before to after bounding to a minimum value. That assures a valid
rectangle to be assigned in all cases.

Gbp-Pq: Name qxcbwindow_set_geometry.diff
src/plugins/platforms/xcb/qxcbwindow.cpp