From 491befb8508095da3579409a5b81b0d96bb18a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 28 Apr 2014 10:15:29 +0200 Subject: [PATCH] Add safety checks to XCB functions in WindowThumbnail Prevents XCB warnings about BadWindow when a tooltip is shown for the first time. REVIEW: 117822 --- src/declarativeimports/core/windowthumbnail.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/declarativeimports/core/windowthumbnail.cpp b/src/declarativeimports/core/windowthumbnail.cpp index 0c3d1e6af..f1871e7af 100644 --- a/src/declarativeimports/core/windowthumbnail.cpp +++ b/src/declarativeimports/core/windowthumbnail.cpp @@ -441,6 +441,9 @@ void WindowThumbnail::resetDamaged() { m_damaged = false; #if HAVE_XCB_COMPOSITE + if (m_damage == XCB_NONE) { + return; + } xcb_damage_subtract(QX11Info::connection(), m_damage, XCB_NONE, XCB_NONE); #endif } @@ -477,6 +480,9 @@ void WindowThumbnail::startRedirecting() return; } #if HAVE_XCB_COMPOSITE + if (m_winId == XCB_WINDOW_NONE) { + return; + } xcb_connection_t *c = QX11Info::connection(); // redirect the window