drop ignored damage events from the X11 event queue

icc-effect-5.14.5
Thomas Lübking 2011-08-28 14:23:34 +02:00
parent 4fb110383d
commit 9d4a7c3d19
1 changed files with 12 additions and 0 deletions

View File

@ -587,7 +587,19 @@ static QVector<QRect> damageRects;
void Toplevel::damageNotifyEvent(XDamageNotifyEvent* e)
{
if (damageRatio == 1.0) // we know that we're completely damaged, no need to tell us again
{ // drop events
while (XPending(display())) {
EventUnion e2;
if (XPeekEvent(display(), &e2.e) && e2.e.type == Extensions::damageNotifyEvent() &&
e2.e.xany.window == frameId()) {
XNextEvent(display(), &e2.e);
continue;
}
break;
}
return;
}
const float area = rect().width()*rect().height();
damageRects.reserve(16);