xcb: recreate xcb window under some conditions
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 25 May 2023 10:45:05 +0000 (11:45 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 25 May 2023 10:45:05 +0000 (11:45 +0100)
commitc1ff5c7c9d578e7064b6443922fcd430f8263f05
tree0b7672d0362d89432f242cf70621983be98b7166
parente71037ed6b799e1d3c968498ae32787db45b7c55
xcb: recreate xcb window under some conditions

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=f9e4402ffeef791e
Last-Update: 2022-11-24

Some netWmState needs to be set during unmap/hide(), which is too
difficult to follow, and causes m_mapped status out of sync very easily
sometimes, which we had tried in
e946e6895a8517a887ac246905e0769edd766fcc .

Destroy the xcb window and recreate new could make the thing
much easier. This practice is also used in other platforms, such
as cocoa plugin.

In Qt 4, the platform window was destroyed and re-created in this
situation on all platforms, which was not ported into Qt5.

See also the code between setWinId(0) and createWinId() in
QWidgetPrivate::setParent_sys() in qwidget_x11.cpp/qwidget_win.cpp/
qwidget_mac.mm.

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