xcb: recreate xcb window under some conditions
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Fri, 13 Jan 2023 07:41:54 +0000 (07:41 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Fri, 13 Jan 2023 07:41:54 +0000 (07:41 +0000)
commit3ecdb4cb9e02bb6b7fbcc81ec131a0fc1efbba51
tree96f5c5b3f27770544fc954d8e8b09fefab7f6630
parent16c091f2fe6e63f6d9dc53e29c8bcf7996876349
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