xcb: recreate xcb window under some conditions
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 27 Mar 2025 11:24:29 +0000 (14:24 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 27 Mar 2025 11:24:29 +0000 (14:24 +0300)
commit2271e3010af4ebe317e47784734eb0b832af0878
tree28ba1024c12eebbfd87c8c5f2b77e3e2f228c15b
parent4ab2f83d92fc677e9c6b0559d92efae1c7466679
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