Version: HEAD (using KDE KDE 3.4.0) Installed from: Compiled From Sources OS: Linux PROBLEM: When a window is resized a shadow of any text label is left. STEPS TO REPRODUCE: * Create a window with some number of plots * Create a label with some text of reasonable text (eg 10 characters) * Maximize Kst * Restore Kst and reduce to a small fraction of the display size but still big enough to see the text * Maximize and restore Kst RESULTS: Artifacts of the text label are clearly visible EXPECTED RESULTS: No artifcats should be visible
Confirmed
At least one problem is that the geometry of the labels is not updated yet (they're auto-adjusted), so the mask for the toplevel view is wrong. Maybe it should paint last. I will test this.
SVN commit 472825 by staikos: paint objects top->down instead of bottom->up to make sure we don't get inproper geometries or artifacts. As a side effect, painting goes from O(n^2) to O(n) which is nice. BUG: 114788 M +4 -2 ksttoplevelview.cpp M +8 -10 kstviewobject.cpp --- trunk/extragear/graphics/kst/kst/ksttoplevelview.cpp #472824:472825 @@ -180,10 +180,13 @@ void KstTopLevelView::paint(KstPaintType type, const QRegion& bounds) { - QRegion boundary = bounds; QPainter p; p.begin(_w); p.setViewXForm(true); + // Paint everything else first so that geometries are properly updated. + paint(type, p, bounds); + + QRegion boundary = bounds; for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) { boundary -= (*i)->clipRegion(); } @@ -191,7 +194,6 @@ p.setClipRegion(boundary); p.fillRect(geometry(), QBrush(_backgroundColor)); p.setClipping(false); - paint(type, p, bounds); } p.end(); --- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #472824:472825 @@ -309,29 +309,27 @@ } } - if (!maximized) { - for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) { + if (!maximized && !_children.isEmpty()) { + QRegion clipRegion = oldRegion; + KstViewObjectList::Iterator begin = _children.begin(); + for (KstViewObjectList::Iterator i = _children.fromLast();; --i) { if (nullBounds || !bounds.intersect(QRegion((*i)->geometry())).isEmpty()) { #ifdef BENCHMARK QTime t; t.start(); #endif - QRegion clipRegion = oldRegion; - KstViewObjectList::Iterator j = i; - for (++j; j != _children.end(); ++j) { - clipRegion -= (*j)->clipRegion(); - } (*i)->_lastClipRegion = clipRegion; p.setClipRegion(clipRegion); (*i)->paint(type, p, bounds); + clipRegion -= (*i)->clipRegion(); #ifdef BENCHMARK int x = t.elapsed(); kstdDebug() << " -> object " << (*i)->tagName() << " took " << x << "ms" << endl; #endif - if ((*i)->_maximized) { - break; - } } + if (i == begin) { + break; + } } }