Review Request: Fix KCategorizedView race

Jaime jtamate at
Thu Dec 8 11:36:51 GMT 2011

The new endless loop (causing a stack overflow here when I resize
systemsettings view) this time is in:
QListView::resizeEvent(QResizeEvent *e)
  that calls QAbstractItemView::resizeEvent(e);
QAbstractItemView::resizeEvent(QResizeEvent *event)
  that calls KCategorizedView::updateGeometries();
QFrame::setFrameRect(QRect const&)
  that calls QWidget::setContextsMargins(cr.left(),,
rect().right() - cr.right(), rect().bottom() - cr.bottom());
  that calls QCoreApplication::notifyInternal(receiver, event)
  that calls QAbstractScrollAreaPrivate::layoutChildren()

This time the infinite recursion is even harder (two squares with 8 squares
inside each one).

In my machine, the infinite recursions seen until now (krunner and
systemsettings) are gone with the attached patch.
(tested resizing them all I can).

Best Regards.

2011/12/8 Christoph Feck <christoph at>

>    This is an automatically generated e-mail. To reply, visit:
> On December 6th, 2011, 6:39 p.m., *Commit Hook* wrote:
> This review has been submitted with commit 08325ba32b72326030004cc28430431193d82fc2 by Thomas Lübking to branch KDE/4.7.
>  This commit causes systemsettings to go into endless recursion, see
> zemo on #plasma confirmed that reverting it fixes the regression.
> - Christoph
> On December 5th, 2011, 2:21 p.m., Thomas Lübking wrote:
>   Review request for kdelibs, Rafael Fernández López and Jaime Torres
> Amate.
> By Thomas Lübking.
> *Updated Dec. 5, 2011, 2:21 p.m.*
> Description
> Also see
> QListView::updateGeometries() has it's own opinion on whether the scrollbars should be visible (valid range) or not
> and triggers a (sometimes additionally timered) resize through ::layoutChildren()
> (the comment above the main block isn't all accurate, layoutChldren is called regardless of the policy)
> As a result QListView and KCategorizedView occasionally started a race on the scrollbar visibility, effectively blocking the UI
> So we prevent QListView from having an own opinion on the scrollbar visibility by
> fixing it before calling the baseclass QListView::updateGeometries() and restoring the policy afterwards
>   Testing
> Yes, resizing the "kcmshell4 kwincompositing", "all effects" KPluginSelector with large scrollbar sizes (bespin/position indicator/32px; oxygen was often sufficient with the default size) after commit e91e5fed6b1aad365e12e919f430c3e8147552d3 (see ) was a reliable way to trigger the issue for me.
> It also showed that resize/updateGeometries occured in pairs (ie 4calls forming  a block), what's never happened again with the patch.
>   *Bugs: * 213068 <>, 287847<>
> Diffs
>    - kdeui/itemviews/kcategorizedview.cpp (46a1cde)
>    - kutils/kpluginselector.cpp (ca0691d)
> View Diff <>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: infinite.diff
Type: application/octet-stream
Size: 2137 bytes
Desc: not available
URL: <>

More information about the kde-core-devel mailing list