[Libreoffice-bugs] [Bug 103571] macOS 100% CPU usage when minimizing screen if multiple documents are opened

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Sep 7 09:29:02 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=103571

--- Comment #26 from Julien Nabet <serval2412 at yahoo.fr> ---
Michael:
the pb seems to be in this part:
  7 libswlo.dylib SwEditWin::DataChanged(DataChangedEvent const&)
/Users/demo/lode/dev/core/sw/source/uibase/docvw/edtwin3.cxx:166
  8 libvcllo.dylib vcl::Window::CompatDataChanged(DataChangedEvent const&)
/Users/demo/lode/dev/core/vcl/source/window/window.cxx:3709
  9 libvcllo.dylib vcl::Window::NotifyAllChildren(DataChangedEvent&)
/Users/demo/lode/dev/core/vcl/source/window/event.cxx:43
  10 libvcllo.dylib vcl::Window::NotifyAllChildren(DataChangedEvent&)
/Users/demo/lode/dev/core/vcl/source/window/event.cxx:48

If I interpret this correctly, there's a recursive loop here:
41  void Window::NotifyAllChildren( DataChangedEvent& rDCEvt )
42  {
43      CompatDataChanged( rDCEvt );
44 
45      vcl::Window* pChild = mpWindowImpl->mpFirstChild;
46      while ( pChild )
47      {
48          pChild->NotifyAllChildren( rDCEvt ); <--------- recursive loop
49          pChild = pChild->mpWindowImpl->mpNext;
50      }
51  }

because of this CompatDataChanged is called many times, so fonts are reloaded
many times.

I thought about adding a "level" argument to NotifyAllChildren so we could
distinguish initial call of NotifyAllChildren with the recursive one.
CompatDataChanged should be called only by initial calls.

It would give:

if nLevel
    CompatDataChanged( rDCEvt );
41  void Window::NotifyAllChildren( DataChangedEvent& rDCEvt, int nLevel /* by
default value = 0 */  )
42  {
43      if (nLevel) 
44          CompatDataChanged( rDCEvt );
45      vcl::Window* pChild = mpWindowImpl->mpFirstChild;
46      while ( pChild )
47      {
48          pChild->NotifyAllChildren( rDCEvt, nLevel+1 );
49          pChild = pChild->mpWindowImpl->mpNext;
50      }
51  }
what do you think?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170907/64ed0844/attachment-0001.html>


More information about the Libreoffice-bugs mailing list