From 28138aa80a14279a72af2818f5bbbaa670283964 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 1 Nov 2021 13:45:30 +0100 Subject: [PATCH] Fix show()/hide() for child windows on xcb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change e946e6895a8517a887ac246905e0769edd766fcc implements proper support for ICCM 4.1.4 window state handling. One issue it addressed is that a show() after a hide() needs to be delayed until the window manager/X-server has processed the previous event. This was handled with a deferred task list to send the map/unmap events. According to ICCM, we should wait for the _NET_WM_STATE notification before processing the deferred events. But this is only true for top level windows, as child windows are not handled by the window manager and will never receive any _NET_WM_STATE notifications. For those, we should use the unmap notify event, which means that the X-server has processed the unmap and handle deferred events once that notification has been received. This fixes an issue in Qt Multimedia, where QVideoWidget would not show the video anymore after a minimize of the player or when making the QVideoWidget fullscreen. This is because QVideoWidget uses an embedded QWindow to render video using HW acceleration. Fixes: QTBUG-97257 Pick-to: 6.2 5.15 Change-Id: I5c47eba3276a1f243bdafd5346f353c7843403bb Reviewed-by: Tor Arne Vestbø Reviewed-by: Lars Knoll --- src/plugins/platforms/xcb/qxcbwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 00bca0def9..7b1072deb3 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1846,7 +1846,7 @@ void QXcbWindow::handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event) if (event->window == m_window) { m_mapped = false; QWindowSystemInterface::handleExposeEvent(window(), QRegion()); - if (!m_isWmManagedWindow) { + if (!m_isWmManagedWindow || parent()) { m_wmStateValid = true; handleDeferredTasks(); }