xcb: recreate xcb window under some conditions
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 24 Nov 2022 17:38:09 +0000 (17:38 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 24 Nov 2022 17:38:09 +0000 (17:38 +0000)
commitf02b174b640aa55f1a38f9a89dd0c636c69657fc
tree527556dc64d3f354765b061c9c89796dd27a5c67
parent627fdbb7efb6714eff5901d8abb0bb3d046c9c2f
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