Add safety checks to XCB functions in WindowThumbnail

Prevents XCB warnings about BadWindow when a tooltip is shown for the
first time.

REVIEW: 117822
This commit is contained in:
Martin Gräßlin 2014-04-28 10:15:29 +02:00
parent 19bac3f06d
commit 491befb850

View File

@ -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